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

Get Exclusive Insights with Every Issue

Join Shalyam Newsletter

Stay ahead in education, research, and innovation—straight to your inbox.