Loading problem...
Your HR analytics system stores two tables:
Each employee appears exactly once in Employee. Bonus contains optional incentive data for some employees.
Build a report that returns employees who meet either condition:
Return exactly these columns:
Notes:
Solve this in both:
Employee:
| empId | name | supervisor | salary |
|-------|--------|------------|--------|
| 3 | Brad | null | 4000 |
| 1 | John | 3 | 1000 |
| 2 | Dan | 3 | 2000 |
| 4 | Thomas | 3 | 4000 |
Bonus:
| empId | bonus |
|-------|-------|
| 2 | 500 |
| 4 | 2000 |[
{"name":"Brad","bonus":null},
{"name":"Dan","bonus":500},
{"name":"John","bonus":null}
]Brad and John have no bonus rows, so they are included with null bonuses. Dan has bonus 500 (<1000), so he is included. Thomas has 2000 and is excluded.
Employee:
| empId | name | supervisor | salary |
|-------|-------|------------|--------|
| 7 | Asha | null | 5000 |
| 8 | Omar | 7 | 3100 |
| 9 | Lina | 7 | 2900 |
Bonus:
| empId | bonus |
|-------|-------|
| 7 | 999 |
| 8 | 1000 |
| 9 | 0 |[
{"name":"Asha","bonus":999},
{"name":"Lina","bonus":0}
]The threshold is strict. Bonus 999 and 0 qualify, while bonus 1000 does not.
Employee:
| empId | name | supervisor | salary |
|-------|-------|------------|--------|
| 10 | Inez | null | 6000 |
| 11 | Ravi | 10 | 3500 |
Bonus:
| empId | bonus |
|-------|-------|
| 10 | 1800 |
| 11 | 1400 |[]Both employees have bonus values at or above 1000, so no rows satisfy the condition.
Constraints