Refer to the exhibit. You need to get information about customer purchases that is stored in the two tables. You would like to see data from the OrderID, CustomerName, OrderAmount, and OrderDate columns. To obtain this information, how would you complete the following partial SQL query?
SELECT Orders.OrderID, Customers.CustomerName, Orders.OrderAmount, Orders.OrderDate
FROM Orders
INNER JOIN _______ ON _____________ = _____________;
- INNER JOIN Orders ON Orders.OrderID=Orders.CustomerID;
- INNER JOIN Customers ON Customer.CustomerID=Customers.CustomerID;
- INNER JOIN Orders ON Orders.CustomerID=Customers.CustomerID;
- INNER JOIN Customers ON Orders.CustomerID=Customers.CustomerID;
Answers Explanation & Hints:
An INNER JOIN returns the rows from both tables that contain the same information in the column or columns specified in the ON clause. To complete the INNER JOIN clause, first specify the name of the additional table, which is the Customers Table in this example. Then specify which columns must contain the same information in order for the row to be returned. In this example, you are joining the two tables on the data in the CustomerID column, which contains the same information in both tables. |