Chapter Two – Introduction to Structured Query Language
Page 2-141
WHERE SHIPMENT.ShipmentID = SHIPMENT_ITEM.ShipmentID
S. Show the ShipperName, ShipmentID, the DepartureDate of the shipment, and Value
for items that were purchased in Singapore. Also show the ShipperName,
ShipmentID, and DepartureDate for all other shipments. Present results sorted by
Value in ascending order, then ShipperName in ascending order, and then
DepartureDate in descending order.
Solutions to Morgan Importing questions are contained in the Microsoft Access database
The LEFT JOIN solution for Oracle Database, MySQL, and SQL Server:
/* *** SQL-Query-MI-S *** */
SELECT ShipperName, SHIPMENT.ShipmentID, DepartureDate, Value
FROM SHIPMENT LEFT JOIN (ITEM JOIN SHIPMENT_ITEM
ON ITEM.ItemID = SHIPMENT_ITEM.ItemID AND
ITEM.City = ‘Singapore’)
ON SHIPMENT.ShipmentID = SHIPMENT_ITEM.ShipmentID
ORDER BY Value, ShipperName, DepartureDate DESC;