Deals Of The Week - hours only!Up to 80% off on all courses and bundles.-Close
Get to know the data
JOIN revisited
9. INNER JOIN
LEFT JOIN
RIGHT JOIN
FULL JOIN
OUTER JOINS
Aliases for tables

Instruction

Excellent! Now, you should be aware that JOIN is actually just one of a few joining methods. It's the most common one, so it's always applied by default when you write the keyword JOIN in your T-SQL statement. Technically speaking, though, JOIN's full name is INNER JOIN.

The example from the previous exercise can be just as well written in the following way:

SELECT
  *
FROM Person
INNER JOIN Car
  ON Person.ID = Car.OwnerID;

Following best practices, it's a good idea to use the full JOIN name. So even though INNER JOIN and JOIN are equivalent, the query is more readable if you use INNER JOIN.

Exercise

Now, use the full name INNER JOIN to join the Room and Equipment tables so that each piece of equipment is shown together with its room.

Stuck? Here's a hint!

Type:

SELECT
  *
FROM Equipment
INNER JOIN Room
  ON Equipment.RoomID = Room.ID;