LEFT JOIN - Keep All Left Rows
LEFT JOIN keeps ALL rows from the left table, even if there's no match on the right.
If an employee has no matching department, department_name will be NULL.
INNER JOIN vs LEFT JOIN:
INNER JOIN: only matching rowsLEFT JOIN: all left rows + matching right rows
LEFT JOIN is essential for finding missing relationships and ensuring no data is lost.
Check your understanding
Get all employees with their department, keeping employees who have no department.
Examples run on the employees sample database. Open any of them in the playground to experiment.