Skip to content
PostgreSQL Summary Stats and Window Functions
Here you can access the summer_medals
table used in the course. To access the table, you will need to specify the medals
schema in your queries (e.g., medals.summer_medals
).
Take Notes
Add notes about the concepts you've learned and SQL cells with queries you want to keep.
Add your notes here
DataFrameavailable as
movie_info
variable
-- Add your own queries here
SELECT *
FROM medals.summer_medals
LIMIT 5
Explore Datasets
Use the summer_medals
table to explore the data and practice your skills!
- Select the
athlete
,event
, andyear
from thesummer_medals
table.- Add another column,
previous_winner
, which contains the previous winner of the same event. - Filter your results for gold medalists.
- Add another column,
- Return the
year
, total number of medalists per year, and running total number of medalists in the history of the Summer Olympics.- Order your results by year in ascending order.
- Return the
country
,year
, and the number of gold medals earned.- Limit your results to the years 2004, 2008, and 2012.
- Each country should have a subtotal of all gold medals earned across the three years.