The document contains SQL statements that create tables for a database including tables for products, customers, orders, and order items. It then inserts sample data into these tables. It also includes some queries on the data like finding cities for suppliers, listing customers from a certain city, and looking up order details by joining multiple tables.
Download as DOC, PDF, TXT or read online on Scribd
0 ratings0% found this document useful (0 votes)
171 views
Create Database Empresa
The document contains SQL statements that create tables for a database including tables for products, customers, orders, and order items. It then inserts sample data into these tables. It also includes some queries on the data like finding cities for suppliers, listing customers from a certain city, and looking up order details by joining multiple tables.
from pedidos as p, clientes as c where p.id_cliente= c.id_cliente
select p.id_pedido, prov.nombre
from proveedores as prov, productos as prod, pedidos_prod as pepro, pedidos as p where prov.id_proveedor = prod.id_proveedor and prod.id_producto=pepro.id_producto and pepro.id_pedido = p.id_pedido