1. Learn
  2. /
  3. Courses
  4. /
  5. PostgreSQL Summary Stats and Window Functions

Exercise

Moving total of countries' medals

What if your data is split into multiple groups spread over one or more columns in the table? Even with a defined frame, if you can't somehow separate the groups' data, one group's values will affect the average of another group's values.

Instructions

100 XP
  • Calculate the 3-year moving sum of medals earned per country.