Learn SQL Lesson

RIGHT JOIN and FULL OUTER JOIN

`RIGHT JOIN` is the mirror image of `LEFT JOIN`: it keeps every row from the right table.

`FULL OUTER JOIN` goes one step further and keeps unmatched rows from both sides.

That means a `FULL OUTER JOIN` can show:

• matched rows • rows that only exist on the left • rows that only exist on the right

This is useful when you want a complete picture of how two tables overlap. In the sample data, Support has no employees, and Eve has no department. `FULL OUTER JOIN` can show both situations in one result.

Practice challenge

Show all departments and all employees, even when there is no match. Return department_name and employee_name.

Open interactive editor