mediumcompany HR · Q4
percentilesstatistics

Median salary by department

For each department with at least one current employee, return the median salary of its current employees.

With an even number of people, the median is the average of the two middle salaries (so 70, 80, 90, 100 gives 85). Round median_salary to 2 decimal places.

output columns
dept_namemedian_salary

uses ,

ctrl + enter to run on the sample data · ctrl + shift + enter to submit

run your query to see the output here. Submit checks it against the sample data, hidden test cases, random data and a large dataset.