As you can see here it becomes tedious to continually write long table names in joins. This is when it becomes useful to alias each table using the first letter of its name (e.g. countries AS c
)! It is standard practice to alias in this way and, if you choose to alias tables or are asked to specifically for an exercise in this course, you should follow this protocol.
Now, for each country, you want to get the country name, its region, and the fertility rate and unemployment rate for both 2010 and 2015.
Example:
- Inner join
countries
(left) and populations
(right) on the code
and country_code
fields respectively. - Alias
countries AS c
and populations AS p
. - Select
code
, name
, and region
from countries
and also select year
and fertility_rate
from populations
(5 fields in total). - Add an additional inner join with
economies
to your previous query by joining on code
. - Include the
unemployment_rate
column that became available through joining with economies
. - Note that
year
appears in both populations
and economies
, so you have to explicitly use e.year
instead of year
as you did before.