/* *** SQL-QUERY-CH08-01 *** */

SELECT			C.CustomerID, C.CustomerName,
				P.ProductNumber, P.ProductName,
				SUM(PS.Quantity) AS TotalQuantity
FROM			CUSTOMER C, PRODUCT_SALES PS, PRODUCT P
WHERE			C.CustomerID = PS.CustomerID
AND				P.ProductNumber = PS.ProductNumber
GROUP BY		C.CustomerID, C.CustomerName,
				P.ProductNumber, P.ProductName
ORDER BY		C.CustomerID, P.ProductNumber;
