Exercise

GDP per capita performance index

A performance index calculation is a good way to compare efficiency metrics across groups. A performance index compares each row to a benchmark.

To run a performance index calculation, take the following steps:

  1. Create a window function that outputs the performance for the entire partition.
  2. Run a ratio that divides each row's performance to the performance of the entire partition.

In this exercise, you will calculate the gdp_per_million for each country relative to the entire world.

  • gdp_per_million = gdp / pop_in_millions

You will reference the country_stats_cleaned table, which is a copy of country_stats without data type issues.

Instructions 1/3

undefined XP
    1
    2
    3
  • Update the query to pull gdp_per_million by region and country from country_stats_clean.
  • Filter for the year 2016, order by gdp_per_million in descending order, and remove all null gdp values.