Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Use Northwind . Look at the results of this query and tell me why it must be an

ID: 3904777 • Letter: U

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.

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.

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.

Suppliers ed- od Order Details CompanyName ContactName QuantityPerUnit Customers CompanyName Fax ContactTide EmployeetD EmployeeTerritories 71 Territ DryID ShpCty CustomerCustomerDemo Territories TerritoryD ShpCountry RegionD Shippers CustomerDemographics CustomerTypelD Region Region ShipperID CompanyName Phone ReportsTo

Explanation / Answer

If you have any doubts, please give me comment...

SELECT DISTINCT Customers.CompanyName

, Orders.ShippedDate

, [Order Details].UnitPrice

, Products.ProductName

FROM Products INNER JOIN [Order Details]

ON Products.ProductID = [Order Details].ProductID

INNER JOIN Orders ON Orders.OrderID = [Order Details].OrderID

INNER JOIN Customers ON Orders.CustomerID = Customers.CustomerID

Where Orders.ShippedDate>= '4/1/2008' AND Orders.ShippedDate<= '4/30/2008' AND products.productname = 'TOFU'

Order By [CompanyName];

UNION will use for AND operation, We can't use UNION instead of INNER JOIN, we can use nested queries instead of INNER JOIN...

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at drjack9650@gmail.com
Chat Now And Get Quote