FunctionRacerProblemsRace

Median Salary

HardSQLSQLite

Return one row with one column, median: the middle salary when all salaries are lined up in order. With an even number of people it is the average of the two middle ones.

Example 1

employees
idnamesalary
1Ada5000
2Ben7000
3Cy3000
4Dee6000
returns
median
5500.0

Constraints

Race itor take your time

Write it in your browser, against the clock. The model query, with a note on each piece of it, comes after.

More SQL problems