Modify the from clause of the query to join the sales


Problem

What will this code looks look like with the below scenario and clause:

SELECT ProductID,sum(LineTotal) as TotalSales
FROM Sales.SalesOrderDetail
GROUP BY ProductID
HAVING sum(LineTotal) > 2000000
ORDER BY sum(LineTotal) DESC;

A. Modify the FROM clause of the query to join the Sales.SalesOrderDetail table to the Production.Product table, using the ProductID column in both tables for the join.

B. Modify the SELECT clause of the query to display the Name column (from the Production.Product table) after the ProductID column in the query results.

C. Modify the GROUP BY clause of the query to group by both ProductID and Name. (This is necessary because columns can only appear in the SELECT clause of a grouped query if they also appear in the GROUP BY column, or if they are used in an aggregate function.)

D. Wherever the ProductID column appears in the query, ensure that it is fully qualified, that is, that it has the name of the appropriate table and a period in front of it (that is, either SalesOrderDetail.ProductID or Product.ProductID). This is necessary because there is a ProductID column in both tables and you must tell SQL which one you mean in each case.

Request for Solution File

Ask an Expert for Answer!!
PL-SQL Programming: Modify the from clause of the query to join the sales
Reference No:- TGS03225617

Expected delivery within 24 Hours