Earning More Than the Manager
staff has columns id, name, salary and manager_id. manager_id is the id of that person's manager, or None for the boss. Return a list of the names of people who earn more than their own manager, in the order they appear.
Example 1
staff {"id":[1,2,3],"name":["Joe","Sam","Max"],"salary":[50,60,90],"manager_id":[3,1,null]}
returns ["Sam"]
Joe (50) has manager Max (90), but Sam (60) earns more than his manager Joe (50).
Constraints
- Every manager_id that is not None is an id in the table
Write it in your browser, against the clock. The model solution, stepped through line by line, comes after.
More pandas problems
- Employee BonusMedium
- Employee DepartmentsMedium
- Find Valid EmailsMedium
- First Time Below ZeroMedium
- Last Person on the BusMedium
- Manager NamesMedium
- Most Orders CustomerMedium
- Most Recent OrderMedium