SELECT
statement to retrieve the desired columns, which are Employee.name
and Bonus.bonus
.LEFT JOIN
to combine the Employee
and Bonus
tables on the empId
column. This ensures that all employees are included in the result set, even if they do not have a corresponding bonus entry.WHERE
clause to filter the results to include only those records where the bonus
is less than 1000 or is NULL
.NULL
if they did not receive a bonus.erDiagram Employee { int empId PK varchar name int supervisor FK int salary } Bonus { int empId PK FK int bonus } Employee ||--o{ Bonus : has