Excercise of NLHCSDL
Excercise of NLHCSDL
4. Show the part number (PNO), name and color of all parts located in
Paris:
SELECT PNO, PName, Color
FROM Part
WHERE City = 'Paris';
5. Show the part number and name of all parts that weigh more than 15:
SELECT PNO, PName
FROM Part
WHERE Weight > 15;
SELECT S.*
FROM Supplier S
JOIN Shipment SH ON S.SNO = SH.SNO
JOIN Part P ON SH.PNO = P.PNO
WHERE S.City = 'London' AND P.City = 'London';
23. Show the maximum and minimum status values in the supplier
table:
SELECT MAX(Status), MIN(Status)
FROM Supplier;
24. Show the maximum and minimum status values in the supplier
table for London suppliers:
SELECT MAX(Status), MIN(Status)
FROM Supplier
WHERE City = 'London';
25. How many parts has each supplier shipped? Show the supplier
number (SNO) and total shipped only:
SELECT S.SNO, COUNT(*) AS TotalShipped
FROM Supplier S
JOIN Shipment SH ON S.SNO = SH.SNO
GROUP BY S.SNO;