Chapter 8 · Window Functions
53. Percentile Rank of Doctor Salaries
Hard40 XPHealthcare
Compute the percentile rank of each doctor's salary using PERCENT_RANK(). Return first_name, last_name, salary, and salary_percentile (rounded to 2 decimals). Order by salary_percentile descending.
Tables
- PKidINT
- first_nameTEXT
- last_nameTEXT
- specialtyTEXT
- FKdepartment_id→ departments.idINT
- emailTEXT
- phoneTEXT
- hire_dateTEXT
- salaryREAL
Need help?
Ask Sol
AI tutor — looks at your current query and nudges you, without spoiling the answer.
Solution
Try the hints first — solving it yourself is what makes it stick.