SQL: Salary Percentile

Medium
SQL — Window Functions SQL PERCENT_RANK
Calculate salary percentile for each employee.

Constraints

Write standard SQL (MySQL 8.0 compatible).

Examples

Example 1:
Input: salary: 30K,50K,70K,90K
Output:
Example 2:
Input: salary: 30K,50K,70K,90K
Output:

Hints

PERCENT_RANK or CUME_DIST.
▲ Console

Install Talent Arabia

Get instant access to jobs and career tools on your device.