1. Learn
  2. /
  3. Courses
  4. /
  5. Improving Query Performance in PostgreSQL

Exercise

Aggregating and sorting populations

You are interested in planning your next vacation. You think it would be fun to visit a country that has changed a lot in recent years. You figure one way to look at change is to look at a change in population. So you focus on countries with big changes in population over the past 25 years.

You have annual population data from the World Bank covering each year from 1990 to 2017. Find the countries with the biggest population changes. Check your query plan to see how the aggregations impact the plan.

Instructions 1/4

undefined XP
    1
    2
    3
    4
  • Find the population change by aggregating population and grouping by the other columns.