Write a SELECT statement that answers this question: What is the total quantity purchased for each product within each category? Return these columns:

a. The category_name column from the category table
b. The product_name column from the products table
c. The total quantity purchased for each product with orders in the Order_Items table

Respuesta :

Answer:

Explanation:

SELECT CategoryName, COUNT(*) AS ProductCount,

MAX(ListPrice) AS MostExpensiveProduct

FROM Categories c JOIN Products p

ON c.CategoryID = p.CategoryID

GROUP BY CategoryName

ORDER BY ProductCount DESC

ACCESS MORE