Employee Bonus

2pts
Accenture

Problem Statement

Human Resources needs to identify employees who received a bonus of less than 1000, as well as those who did not receive a bonus at all, for a secondary review process.

Write an SQL query to report the name and bonus amount of each employee with a bonus less than 1000.

Rules:

  • If an employee does not have a bonus record, they should still be included in the report with a null value for the bonus.
  • The condition for inclusion is bonus < 1000 OR bonus is null.
  • Return the result table containing the name and bonus columns.
  • Results must be sorted by name in ascending order.
Tests your understanding of
Basic SQL, Joins, LEFT JOIN, NULL Handling and Filtering

Input Tables

employee
empId(INTEGER)name(VARCHAR)supervisor(INTEGER)salary(INTEGER)
3Bradnull4000
1John31000
2Dan32000
4Thomas34000
bonus
empId(INTEGER)bonus(INTEGER)
2500
42000

Expected Output

name(VARCHAR)bonus(INTEGER)
Bradnull
Dan500
Johnnull

Tags

EasyBasic SQLJoinsLEFT JOINNULL HandlingFiltering
10-15 min
72%

Hints