Keep employees whose team has no budget
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) -> dataframeExample 1
Input
budget_or_null(staff, budgets)staff
More rows not shown
| name | team | salary | hired | manager |
|---|---|---|---|---|
| Ada | eng | 120 | 2021-03-01 | Grace |
| Grace | eng | 150 | 2019-06-15 | NULL |
| Linus | eng | 95 | 2022-01-10 | Grace |
| Mel | sales | 80 | 2020-11-05 | Kay |
| Kay | sales | 110 | 2018-02-20 | NULL |
| Ivan | sales | 80 | 2023-07-01 | Kay |
| Jean | design | 105 | 2021-09-30 | NULL |
| Nia | design | 140 | 2022-05-04 | Jean |
budgets
| team | budget |
|---|---|
| eng | 900 |
| sales | 400 |
| ops | 250 |
Output
More rows not shown
| name | budget |
|---|---|
| Ada | 900 |
| Grace | 900 |
| Ivan | 400 |
| Jean | NULL |
| Kay | 400 |
| Linus | 900 |
| Mel | 400 |
| Nia | NULL |