Get to know the data
JOIN revisited
LEFT JOIN
RIGHT JOIN
14. RIGHT JOIN again
FULL JOIN
OUTER JOINS
NATURAL JOIN
Aliases for tables

Instruction

Very well! Let's do one more exercise.

Exercise

For each student show the room the student is assigned to. Show also students who are not assigned to any room. Use a RIGHT JOIN.

Stuck? Here's a hint!

Type:

SELECT
  *
FROM room
RIGHT JOIN student
  ON student.room_id = room.id;