Keep employees whose team has no budget

Data framesMedium9 min

Your task

Given staff with columns name, team, salary, hired and manager, and budgets with columns team and budget, return every employee with their budget, using null where the team has no budget row. Return name and budget, sorted by name ascending.

Examples

budget_or_null(staff: dataframe, budgets: dataframe) -> dataframe
Example 1
Inputbudget_or_null(staff, budgets)
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
budgets
teambudget
eng900
sales400
ops250
Output
namebudget
Ada900
Grace900
Ivan400
JeanNULL
Kay400
Linus900
Mel400
NiaNULL
More rows not shown