How do we retain all records from the right table while matching optional left table data?
RIGHT JOIN returns all records from the right table and matched values from the left table.
Auditing departments with no assigned employees, empty catalog categories, unused promo codes.
SELECT employees.name,
departments.department_name
FROM employees
RIGHT JOIN departments
ON employees.department_id = departments.id;Practice typing production-grade SQL code for SQL RIGHT JOIN.