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

Cumulative Percentage (Pareto)

Order products by total sales descending and return the running cumulative percentage of total sales, rounded to 2 decimals.

Table schema

Sales(id INT PRIMARY KEY, product VARCHAR(20), amount INT)

Sample data

id | product | amount
1 | Pen | 20
2 | Pen | 30
3 | Book | 150
4 | Bag | 300

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.