SIMULATION
You have a database named Sales that contains the tables as shown in the exhibit. (Click the Exhibit

button.)
You need to create a query that meets the following requirements:
References columns by using one-part names only.


Groups aggregates only by SalesTerritoryID, and then by ProductID.


Orders the results in descending order by SalesTerritoryID and then by ProductID in descending order


for both.
Part of the correct T-SQL statement has been provided in the answer area. Provide the complete code.

Correct Answer:
Please review the explanation part for this answer
Explanation/Reference:
Explanation:
SELECT SalesTerritoryID,
ProductID,
AVG(UnitPrice),
MAX(OrderQty)
MAX(DiscountAmount)
FROM Sales.Details
GROUP BY SalesTerritoryID, ProductID
ORDER BY SalesTerritoryID DESC, ProductID DESC