El documento describe la creación de una base de datos para un proyecto en SQL. Se crean tablas para proveedores, artículos, inventario, ventas, empleados y clientes. Luego se insertan registros de prueba en las tablas de proveedores y artículos.
13. select No_Almacen, Nom_Art, Existencia
from Inventario
where No_Almacen = 2 and Existencia between 10 and 40
orderby Existencia DESC;
SELECTCOUNT(*)AS PRODUCTOS,
MIN(Precio)AS price_min,
MAX(Precio)AS price_max,
AVG(Precio)AS price_avg
from Articulos
select Id_Empleado, Edad, Puesto
from Detalle_Emp
where Edad between 23 and 29
orderby Edad;
-------------------------------------------
Reporte Existencia en el Almacén en Pesos
-------------------------------------------
SELECT Nom_Art, No_Almacen,(Existencia*Precio)AS total_Dinero_Almacén
FROM Inventario
where No_Almacen = 2
orderby total_Dinero_Almacén DESC;
------------------------------------------
Reportes De Ventas Efectuadas
------------------------------------------
select Id_Factura,Nom_Art,(Importe_Uni * Piezas)AS Total_De_Importe
from Detalle_Venta
where Id_Factura between 5004 and 5008
orderby Id_Factura;
-------------------------------------------
Reporte De Un Solo Proveedor Especifico
-------------------------------------------
select Id_Articulo, Nom_Art, Existencia, Id_Proveedor AS Unico_Proveedor
from Inventario
where Id_Proveedor = 1013 OR Id_Proveedor = 1015
orderby Existencia ASC;
------------------------------------------
Reporte De Mayor Factura
-----------------------------------------
select Id_Factura, Total
from Detalle_Venta
orderby Id_Factura, Total DESC;
-----------------------------------------