SELECT Customer_T.CustomerlD, Order_T.CustomerID, CustomerName, OrderID FROM Customer_T INNER JOIN Order_T ON Customer_T.CustomerID = Order_T.CustomerlD ORDER BY OrderlD; Result: Same as the previous...


What are the customer IDs and names of all customers, along with the order IDs for all the orders they have placed?


SELECT Customer_T.CustomerlD, Order_T.CustomerID,<br>CustomerName, OrderID<br>FROM Customer_T INNER JOIN Order_T ON<br>Customer_T.CustomerID = Order_T.CustomerlD<br>ORDER BY OrderlD;<br>Result: Same as the previous query.<br>Simplest of all would be to use the JOIN...USING syntax, if this is supported by<br>the RDBMS you are using. If the database designer thought ahead and used identical<br>column names for the primary and foreign keys, as has been done with CustomerlID in<br>the Customer_T and Order_T tables, the following query could be used:<br>SELECT Customer_T.CustomerlD, Order_T.CustomerID,<br>CustomerName, OrderID<br>FROM Customer_T INNER JOIN Order_T USING CustomerlD<br>ORDER BY OrderID;<br>

Extracted text: SELECT Customer_T.CustomerlD, Order_T.CustomerID, CustomerName, OrderID FROM Customer_T INNER JOIN Order_T ON Customer_T.CustomerID = Order_T.CustomerlD ORDER BY OrderlD; Result: Same as the previous query. Simplest of all would be to use the JOIN...USING syntax, if this is supported by the RDBMS you are using. If the database designer thought ahead and used identical column names for the primary and foreign keys, as has been done with CustomerlID in the Customer_T and Order_T tables, the following query could be used: SELECT Customer_T.CustomerlD, Order_T.CustomerID, CustomerName, OrderID FROM Customer_T INNER JOIN Order_T USING CustomerlD ORDER BY OrderID;

Jun 08, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here