Subquery challenge
You're near the finish line! Test your understanding of subquerying with a challenge problem.
Suppose you're interested in analyzing inflation and unemployment rate for certain countries in 2015. You are interested in countries with "Republic"
or "Monarchy"
as their form of government.
You will use the field gov_form
to filter for these two conditions, which represents a country's form of government. You can review the different entries for gov_form
in the countries
table.
This exercise is part of the course
Joining Data in SQL
Exercise instructions
- Select country
code
,inflation_rate
, andunemployment_rate
fromeconomies
. - Filter
code
for the set of countries which contain the words"Republic"
or"Monarchy"
in theirgov_form
.
Hands-on interactive exercise
Have a go at this exercise by completing this sample code.
-- Select relevant fields
___
WHERE year = 2015
AND code IN
-- Subquery returning country codes filtered on gov_form
(___)
ORDER BY inflation_rate;