You are on page 1of 3

PC1 SQL SERVER

1. F
select productid as [CodigoProducto],
productname as NombreProducto,
categoryid CodigoCategoria,
unitprice PrecioUnitario
from production.products
where productid >= 60
go

2. 4
SELECT
orderid CodigoOrden,
productid CodigoProducto,
unitprice PrecioUnitario,
qty Cantidad,
(qty * unitprice) as VentaTotal,
(case
when (qty * unitprice) < 500 then 'BAJAS'
else 'ALTAS'
end) as Categoria
FROM Sales.OrderDetails
GO
3. Dd
select
SC.custid as IdCliente,
sc.contactname as NombreCliente,
SO.orderid,
pp.productname NombreProducto,
((SOD.qty * SOD.unitprice) - SOD.discount) Venta
from Sales.Customers as SC
inner join Sales.Orders as SO
on SC.custid = SO.custid
inner join Sales.OrderDetails as SOD
on SO.orderid = SOD.orderid
inner join Production.Products as PP
on SOD.productid = PP.productid
go
4. 6
5. 7

You might also like