Loading…
The classic ranking question, on tables you can query. For each department, find the second-highest base salary among active employees.
employment_status active. Two people on the same salary share a rank. Return department_name and second_highest_salary, one row per department. Order by department_name.Create a free account to save your progress and reveal the worked answer for this free exercise. The complete practice library is available with Practice Pass or Mastery.