Skip to content

Instantly share code, notes, and snippets.

@prof3ssorSt3v3
Created June 3, 2019 19:09
Show Gist options
  • Save prof3ssorSt3v3/7a0e90e393f6ead7eb7a79406a364e32 to your computer and use it in GitHub Desktop.
Save prof3ssorSt3v3/7a0e90e393f6ead7eb7a79406a364e32 to your computer and use it in GitHub Desktop.
SELECT p.productName, pl.productLine, c.customerName
FROM productlines AS pl INNER JOIN products AS p
ON pl.productLine = p.productLine
INNER JOIN orderdetails AS od
USING (productCode)
INNER JOIN orders AS o
USING (orderNumber)
INNER JOIN customers AS c
USING (customerNumber)
INNER JOIN employees AS e
ON c.salesRepEmployeeNumber = e.employeeNumber
INNER JOIN offices AS off
USING (officeCode)
WHERE pl.productLine = 'Planes' AND off.city = 'Sydney';
@nyansera-web
Copy link

Excellent tutor!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment