linfo2172-databases/P3/queries/query2.sql

9 lines
227 B
SQL

-- Author: Anatole Huet
-- Determine the total number of purchases for each product. List the number of the product, as well as the total number of purchases.
SELECT product, Count(*) as cnt
FROM Purchases
GROUP BY product
;