Database Which query in this relational database (represented by relational diagram) will provide you with the list of the 3 most transported products by shipper DHL in January 2020? Select one: a. SELECT TOP(3) p.ProductName, COUNT(od.Quantity) FROM Products p INNER JOIN [Order Details] od ON p. ProductID = od. ProductiD INNER JOIN Orders o ON od.OrderID = o.OrderID WHERE o. ShipVia = 'DHL' AND .ShippedDate > '01-01-2020' AND o.ShippedDate < '31-01-2020' GROUP BY p.ProductID, o.ShipVia ORDER BY COUNT (od.Quantity) DESC b. SELECT TOP (3) p.ProductID, p.ProductName, SUM(od.Quantity) FROM Products p LEFT JOIN [Order Details] od ON p.ProductID = od.ProductiD LEFT JOIN Orders o ON od.OrderID = o.OrderID LEFT JOIN Shippers s ON o.ShipVia = s.ShipperID WHERE S.CompanyName LIKE 'DHL' AND MONTH(o.ShippedDate) = 1 AND YEAR (o.ShippedDate) = 2020 GROUP BY od.ProductiD, o.ShipAddress ORDER BY SUM(od.Quantity) ASC C SELECT TOP (3) p.ProductID, p.ProductName, COUNT(od.Quantity) FROM Products p FULL JOIN [Order Details] od ON p.ProductID = od. ProductID FULL JOIN Orders o ON od.OrderID = o.OrderID FULL JOIN Shippers s ON o.ShipVia = s. ShipperID WHERE .CompanyName = 'DHL' AND MONTH(o.ShippedDate) = 1 AND YEAR(o.ShippedDate) = 2020 GROUP BY p.ProductID, p.ProductName ORDER BY COUNT (od.Quantity) DESC d. SELECT TOP(3) p.ProductID, p.ProductName, SUM(od.Quantity) FROM Products p INNER JOIN [Order Details] od ON p.ProductID = od. ProductiD INNER JOIN Orders o ON od.OrderID = o.OrderID INNER JOIN Shippers s ON o.ShipVia = s.ShipperID WHERE S.CompanyName = 'DHL' AND MONTH(o.ShippedDate) = 1 AND YEAR(o.ShippedDate) = 2020 GROUP BY p.ProductID, p. ProductName ORDER BY SUM(od.Quantity) DESC e. SELECT TOP(3) p.ProductID, p.ProductName, COUNT (od.Quantity) FROM Products p INNER JOIN [Order Details] od ON p.ProductID = od. ProductID INNER JOIN Orders o ON od.OrderID = o.OrderID INNER JOIN Shippers s ON o.ShipVia = s.ShipperID WHERE S.CompanyName = 'DHL' AND o.ShippedDate > '01-01-2020' AND o.ShippedDate < '31-01-2020' GROUP BY .ShipperID, s.CompanyName ORDER BY COUNT (od.Quantity) DESC
Which query in this relational database (represented by relational diagram) will provide you with the list of the 3 most transported products by
shipper DHL in January 2020?
Select one:
a.
SELECT TOP(3) p.ProductName, COUNT(od.Quantity)
FROM Products p
INNER JOIN [Order Details] od ON p. ProductID = od. ProductiD
INNER JOIN Orders o ON od.OrderID = o.OrderID
WHERE o. ShipVia = 'DHL' AND .ShippedDate > '01-01-2020' AND o.ShippedDate < '31-01-2020'
GROUP BY p.ProductID, o.ShipVia
ORDER BY COUNT (od.Quantity) DESC
b.
SELECT TOP (3) p.ProductID, p.ProductName, SUM(od.Quantity)
FROM Products p
LEFT JOIN [Order Details] od ON p.ProductID = od.ProductiD
LEFT JOIN Orders o ON od.OrderID = o.OrderID
LEFT JOIN Shippers s ON o.ShipVia = s.ShipperID
WHERE S.CompanyName LIKE 'DHL' AND MONTH(o.ShippedDate) = 1 AND YEAR (o.ShippedDate) = 2020
GROUP BY od.ProductiD, o.ShipAddress
ORDER BY SUM(od.Quantity) ASC
C
SELECT TOP (3) p.ProductID, p.ProductName, COUNT(od.Quantity)
FROM Products p
FULL JOIN [Order Details] od ON p.ProductID = od. ProductID
FULL JOIN Orders o ON od.OrderID = o.OrderID
FULL JOIN Shippers s ON o.ShipVia = s. ShipperID
WHERE .CompanyName = 'DHL' AND MONTH(o.ShippedDate) = 1 AND YEAR(o.ShippedDate) = 2020
GROUP BY p.ProductID, p.ProductName
ORDER BY COUNT (od.Quantity) DESC
d.
SELECT TOP(3) p.ProductID, p.ProductName, SUM(od.Quantity)
FROM Products p
INNER JOIN [Order Details] od ON p.ProductID = od. ProductiD
INNER JOIN Orders o ON od.OrderID = o.OrderID
INNER JOIN Shippers s ON o.ShipVia = s.ShipperID
WHERE S.CompanyName = 'DHL' AND MONTH(o.ShippedDate) = 1 AND YEAR(o.ShippedDate) = 2020
GROUP BY p.ProductID, p. ProductName
ORDER BY SUM(od.Quantity) DESC
e.
SELECT TOP(3) p.ProductID, p.ProductName, COUNT (od.Quantity)
FROM Products p
INNER JOIN [Order Details] od ON p.ProductID = od. ProductID
INNER JOIN Orders o ON od.OrderID = o.OrderID
INNER JOIN Shippers s ON o.ShipVia = s.ShipperID
WHERE S.CompanyName = 'DHL' AND o.ShippedDate > '01-01-2020' AND o.ShippedDate < '31-01-2020'
GROUP BY .ShipperID, s.CompanyName
ORDER BY COUNT (od.Quantity) DESC
Step by step
Solved in 2 steps