Interview Questions/SQL/Employee Bonus

Employee Bonus

Preview mode. Log in to edit, run, submit, and save progress.

Medium

Employee Bonus

You have two tables: Employee and Bonus. The Bonus table contains bonuses for some employees, but not all. Write a SQL query to report the name and bonus of each employee whose bonus is less than 1000. Employees with no bonus entry should also be included (treat their bonus as NULL). Return the result in any order.

Examples

Example 1

Brad and John have no bonus entry (NULL < 1000 counts). Dan has bonus 500 < 1000. Thomas has bonus 2000 which is not less than 1000.

Approach hint

Start with a simple approach, explain the trade-off, then move toward a cleaner or more scalable solution.

Common mistake

Skipping assumptions, edge cases, or trade-offs can make an otherwise good answer feel incomplete.

query.sql