

0 / 2 embers
0 / 3000 xp
click for more info
Complete a lesson to start your streak
click for more info
Difficulty: 3
click for more info
Not enough gems
Cost: 6 gems
1: Joins
incomplete
2: Namespacing on Tables
incomplete
3: Left Join
incomplete
4: Right Join
incomplete
5: Full Join
incomplete
6: Joins Quiz
incomplete
7: Joins Quiz
incomplete
8: Joins Quiz
incomplete
9: Join Practice
incomplete
10: Query Practice – Support Tickets
incomplete
Back
ctrl+,
Next
ctrl+.
This lesson's interactive features are locked, please to keep using them
A FULL JOIN combines the result set of the LEFT JOIN and RIGHT JOIN commands. It returns all records from both table_a and table_b regardless of whether or not they have matches.
Switch between join types below to see which rows survive. Margaret has no dept_id, and the Design department has no employees, so they only appear once you reach a FULL JOIN. Hover a row to trace where it goes.
Every row from both employees and departments, lined up wherever the dept_id matches.
Every row from departments; employees fills in where the dept_id matches, or stays empty.
Every row from employees; departments fills in where the dept_id matches, or stays empty.
Only rows where employees and departments share a matching dept_id.
| emp_id | name | dept_id |
|---|---|---|
| 1 | Ada | eng |
| 2 | Grace | eng |
| 3 | Linus | ops |
| 4 | Margaret | NULL |
| dept_id | dept_name |
|---|---|
| eng | Engineering |
| ops | Operations |
| design | Design |
| dept_id | emp_id | name | dept_name |
|---|---|---|---|
| eng | 1 | Ada | Engineering |
| eng | 2 | Grace | Engineering |
| ops | 3 | Linus | Operations |