Cumulative Distribution of Salaries
Medium
Window Functions
Return each employee's name, salary and the percentage of employees earning less than or equal to that salary (cumulative distribution) rounded to two decimals. Order by salary, then name.
Table schema
Employees(id INT PRIMARY KEY, name VARCHAR(50), salary INT)Sample data
id | name | salary
1 | A | 100
2 | B | 200
3 | C | 200
4 | D | 300
Discussion
No discussions yet.
Shalyam Support
Hi! Ask us anything — we'll reply on WhatsApp or Telegram within 24 hours.