Question
Use Northwind . Look at the results of this query and tell me why it must be an invalid query. Choose all the acceptable answers.
Use Northwind . Look at the results of this query and tell me why it must be an invalid query.
Choose all the acceptable answers.
SELECT Customers.CompanyName
, Orders.ShippedDate
, [Order Details].UnitPrice
, Products.ProductName
FROM Products INNER JOIN Customers
INNER JOIN Orders ON Customers.CustomerID = Orders.CustomerID
INNER JOIN [Order Details] ON Orders.OrderID = [Order Details].OrderID
ON [Order Details].ProductID = [Order Details].ProductID
Where Orders.ShippedDate Between '4/1/2008' And '4/30/2008'
And products.productname = 'TOFU'
Order By CompanyName
There is no ON clause for the first INNER JOIN ( Products INNER JOIN Customers ). | ||
You need a UNION , you can't just write INNER JOIN 2 times | ||
This query does not retrieve shipments that occurred after midnight on 4/30/2018. | ||
Currently, the query is invalid because Products joining Customers is a cross join. | ||
There are no orders for tofu in April 2008, so how you got this query to display those dates with tofu orders is beyond me | ||
Order by company name should be in brackets. ORDER BY [Company Name].CompanyName | ||
I don't know why it would be invalid because it brought back 186 results. | ||
We should use the "SELECT DISTINCT" syntax. |
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started