List Employees With a Bonus Under 1000 or No Bonus Record

Quick Overview

Write a SQL query that lists each employee's name and bonus when the bonus is below 1000 or the employee has no bonus record at all. It tests outer join behavior, how NULL behaves in a WHERE comparison, and where a join filter belongs.

List Employees With a Bonus Under 1000 or No Bonus Record

Company: NVIDIA

Role: Data Scientist

Category: Data Manipulation (SQL/Python)

Difficulty: easy

Interview Round: Other

Report the `name` and `bonus` of every employee whose bonus is less than 1000. Employees who have no row in `Bonus` are included too, with a NULL bonus. ### Input Table(s) `Employee` | Column | Type | Meaning | | --- | --- | --- | | empId | INT | Employee id. Primary key. | | name | VARCHAR(255) | Employee name. Names are not guaranteed to be unique. | | supervisor | INT | `empId` of the employee's supervisor, NULL when there is none. | | salary | INT | Employee salary. | `Bonus` | Column | Type | Meaning | | --- | --- | --- | | empId | INT | Employee id. Primary key, so an employee has at most one bonus row. | | bonus | INT | Bonus amount for that employee. | ### Output Contract - Columns, in this order: `name`, `bonus`. - One row per qualifying employee. `bonus` is the amount from `Bonus`, or NULL when the employee has no `Bonus` row. - Sort by `empId` ascending (the column is used for ordering only and is not returned). - No rounding; both values are returned as stored. ### Example `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 | Expected result: | name | bonus | | --- | --- | | John | NULL | | Dan | 500 | | Brad | NULL | John and Brad have no `Bonus` row, so they appear with a NULL bonus. Dan's bonus of 500 is under 1000. Thomas is left out because his bonus is 2000. ### Constraints and Clarifications - `Employee` has 1 to 10,000 rows and `Bonus` has 0 to 10,000 rows. - `bonus` and `salary` are integers from 1 to 10,000. - The threshold is strict: an employee with a bonus of exactly 1000 is not reported. - `supervisor` and `salary` are not needed for this report. - Two employees can share a name. Each is reported as a separate row. - A `Bonus` row whose `empId` does not exist in `Employee` is not reported. ```hint NULL comparisons Check what `bonus < 1000` evaluates to for an employee who has no bonus row, and whether `WHERE` keeps that row. ```

Overview: Write a SQL query that lists each employee's name and bonus when the bonus is below 1000 or the employee has no bonus record at all. It tests outer join behavior, how NULL behaves in a WHERE comparison, and where a join filter belongs.

NVIDIA logo
NVIDIA
Nov 24, 2026
easyData ScientistOtherData Manipulation (SQL/Python)
0
0

Report the name and bonus of every employee whose bonus is less than 1000. Employees who have no row in Bonus are included too, with a NULL bonus.

Input Table(s)

Employee

ColumnTypeMeaning
empIdINTEmployee id. Primary key.
nameVARCHAR(255)Employee name. Names are not guaranteed to be unique.
supervisorINTempId of the employee's supervisor, NULL when there is none.
salaryINTEmployee salary.

Bonus

ColumnTypeMeaning
empIdINTEmployee id. Primary key, so an employee has at most one bonus row.
bonusINTBonus amount for that employee.

Output Contract

  • Columns, in this order: name , bonus .
  • One row per qualifying employee. bonus is the amount from Bonus , or NULL when the employee has no Bonus row.
  • Sort by empId ascending (the column is used for ordering only and is not returned).
  • No rounding; both values are returned as stored.

Example

Employee

empIdnamesupervisorsalary
3BradNULL4000
1John31000
2Dan32000
4Thomas34000

Bonus

empIdbonus
2500
42000

Expected result:

namebonus
JohnNULL
Dan500
BradNULL

John and Brad have no Bonus row, so they appear with a NULL bonus. Dan's bonus of 500 is under 1000. Thomas is left out because his bonus is 2000.

Constraints and Clarifications

  • Employee has 1 to 10,000 rows and Bonus has 0 to 10,000 rows.
  • bonus and salary are integers from 1 to 10,000.
  • The threshold is strict: an employee with a bonus of exactly 1000 is not reported.
  • supervisor and salary are not needed for this report.
  • Two employees can share a name. Each is reported as a separate row.
  • A Bonus row whose empId does not exist in Employee is not reported.