Three highest salaries

Data framesEasy7 min

Your task

Given staff with columns name, team, salary, hired and manager, return the three highest-paid rows. Return only name and salary, sorted by salary descending, breaking ties by name ascending.

Examples

top_three(staff: dataframe) -> dataframe
Example 1
Inputtop_three(staff)
staff
nameteamsalaryhiredmanager
Adaeng1202021-03-01Grace
Graceeng1502019-06-15NULL
Linuseng952022-01-10Grace
Melsales802020-11-05Kay
Kaysales1102018-02-20NULL
Ivansales802023-07-01Kay
Jeandesign1052021-09-30NULL
Niadesign1402022-05-04Jean
More rows not shown
Output
namesalary
Grace150
Nia140
Omar125