Deals Of The Week - hours only!Up to 80% off on all courses and bundles.-Close
2. Get to know the data – the Country table
Very simple subqueries
Subqueries with multiple results
Correlated subqueries
Other subqueries


Complex instructions require complex examples. Let's imagine a travel agency and its database. We're going to work with as many as 5 tables this time: Country, City, Mountain, Trip, and HikingTrip. Let's analyze them. Use the Database button on the right to see the contents of each table discussed.

Let's start with the Country table.

As you can see, this table stores information about many different countries. The travel agency operates in all of these countries, so we need some basic info in the table about a country's:

  • ID
  • Name
  • Population
  • Area (in square kilometers)


Open the Database tab on the right, and take a look at the Country table. Then, click Next exercise to proceed.