Last active
December 23, 2015 12:19
-
-
Save yucao24hours/6634711 to your computer and use it in GitHub Desktop.
テーブルSales,Customers,Employees,Productsを結合して、Sales.Quantityが200以上のデータについてQuantity,CustomerName,ProductName,EmployeeNameを表示しなさい。JOINを用いずに書きなさい。(SQL書き方ドリル / 第3章 その2 第4問)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT | |
s.Quantity | |
, c.CustomerName | |
, p.ProductName | |
, e.EmployeeName | |
FROM | |
Sales AS s | |
JOIN | |
Customers AS c | |
ON | |
s.CustomerID = c.CustomerID | |
JOIN | |
Employees AS e | |
ON | |
e.EmployeeID = s.EmployeeID | |
JOIN | |
Products AS p | |
ON | |
p.ProductID = s.ProductID | |
WHERE | |
s.Quantity >= 200 | |
; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT | |
s.Quantity | |
, c.CustomerName | |
, p.ProductName | |
, e.EmployeeName | |
FROM | |
Sales AS s | |
, Customers AS c | |
, Employees AS e | |
, Products AS p | |
WHERE | |
s.Quantity >= 200 | |
AND | |
s.CustomerID = c.CustomerID | |
AND | |
s.ProductID = p.ProductID | |
AND | |
s.EmployeeID = e.EmployeeID | |
; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment