Question: Why doesn't this SQL Statement work? Join two tables. You may have noticed that when you counted the products that were ordered in large and
Why doesn't this SQL Statement work?
Join two tables.
You may have noticed that when you counted the products that were ordered in large and small quantities, you only had access to the product numbers. The OrderDetails table does not contain any product names.
To see the names of products that have been ordered, you have to join the OrderDetails table and the Products table.
Remember the dot notation? OrderDetails.ProductID and Products.ProductID are the fields that will create the join.
Enter this SQL query all on one line:
SELECT ProductName, Quantity FROM Products JOIN OrderDetails on OrderDetails.ProductID = Products.ProductID WHERE Quantity <5
Can you modify the SQL so that the results also display the price of each item?
Copy all the records shown as results and paste them into your lab document.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
