Products Sold More Than Average
Medium
Aggregation & GROUP BY
Return the product_id of products whose total quantity sold is above the average of the per-product totals. Order by product_id.
Table schema
Sales(id INT PRIMARY KEY, product_id INT, quantity INT)Sample data
id | product_id | quantity
1 | 1 | 10
2 | 1 | 5
3 | 2 | 4
4 | 3 | 20
Discussion
No discussions yet.
Shalyam Support
Hi! Ask us anything — we'll reply on WhatsApp or Telegram within 24 hours.