Exercise

Where to place a region filter

Population alone does not predict the number of Olympians. Researchers propose that gross domestic product (GDP) together with population can predict the number of Olympians. Luckily the World Bank also collects GDP per capita (GDP divided by the number of citizens) on many countries.

Focusing again on Africa, the most populous countries in 2014 were Nigeria, Ethiopia, and Egypt; however, the only African countries sending athletes to the 2014 Olympics were Morocco, Togo, and Zimbabwe.

Determine which African countries have 2014 GDP data and whether Morocco, Togo, and Zimbabwe have high GDPs.

Instructions 1/3

undefined XP
  • 1

    Use region as a non-linking join condition to find the countries in Africa. Note how many records are returned.

  • 2

    Move region to the WHERE clause to remove records, instead of returning null countries for non-African records.

  • 3

    Region is again a JOIN condition as in the first query. Limit the demographics table records with the oregions table.