WHERE do people live?
In this exercise, you will strengthen your knowledge of subquerying by identifying capital cities in order of largest to smallest population.
Follow the instructions below to get the urban area population for capital cities only. You'll use the countries
and cities
tables displayed in the console to help identify columns of interest as you build your query.
This exercise is part of the course
Joining Data in SQL
Exercise instructions
- Return the
name
,country_code
andurbanarea_pop
for all capital cities (not aliased).
Hands-on interactive exercise
Have a go at this exercise by completing this sample code.
-- Select relevant fields from cities table
___
-- Filter using a subquery on the countries table
___
ORDER BY urbanarea_pop DESC;