How to query more than one table
2. Get to know the tables
Creating JOINs
Referencing columns
Let's practice

Instruction

Before we start, let's explain the data sets we're going to work with.

Remember the Car table from Part 2? We're going to use it now together with another table named Person. We'll show you all the examples in this part based on these two tables.

We'll have cars (Car table) and their owners (Person table). We can idnetify the owner of a particular car because we have the OwnerId column in the Car table that contains an ID from the Person table. Easy, right?

Take a look at the columns the tables contain:

  • Person (Id, Name, Age)
  • Car (Id, Brand, Model, Price, OwnerId)

Exercise

In case you're already fed up with cars, we've created a new set of data for all the exercises in this part.

We're going to work with movies and their directors.

Open the Database tab on the right, and study the tables. Think about the following question: how do we know who directed a specific movie?

When you're done, simply click Next exercise and we'll tell you the answer.