Skip to main content
Admissions guidance, study banks, and career tools โ€” get started on Shalyam

Products Sold More Than Average

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.

Rewards ยท v2.1

Join Shalyam Newsletter

Get exclusive insights with every issue: education, research and innovation news.

One email a week. Unsubscribe any time.