How can we keep employees even when they have no department match?
A LEFT JOIN preserves all rows from the left table, filling non-matching right-table fields with NULL.
Preserving all employees, unassigned staff auditing, optional relationship joins.
SELECT e.name, d.department_name
FROM employees e
LEFT JOIN departments d
ON e.department_id = d.department_id;Practice typing production-grade SQL code for LEFT JOIN.