Analyzing the Olympics dataset using PostgreSQL SQL queries.
In this project, I have tackled the following 20 problems using the Olympics dataset:
- How many Olympics games have been held?
- List down all Olympics games held so far.
- Mention the total number of nations that participated in each Olympics game.
- Which year saw the highest and lowest number of countries participating in Olympics?
- Which nation has participated in all of the Olympic games?
- Identify the sport that was played in all summer Olympics.
- Which sports were played only once in the Olympics?
- Fetch the total number of sports played in each Olympic game.
- Fetch details of the oldest athletes to win a gold medal.
- Find the ratio of male and female athletes participated in all Olympic games.
- Fetch the top 5 athletes who have won the most gold medals.
- Fetch the top 5 athletes who have won the most medals (gold/silver/bronze).
- Fetch the top 5 most successful countries in Olympics based on the number of medals won.
- List down the total gold, silver, and bronze medals won by each country.
- List down the total gold, silver, and bronze medals won by each country corresponding to each Olympic game.
- Identify which country won the most gold, most silver, and most bronze medals in each Olympic game.
- Identify which country won the most gold, most silver, most bronze medals, and the most medals in each Olympic game.
- Which countries have never won a gold medal but have won silver/bronze medals?
- In which sport/event, India has won the highest number of medals.
- Break down all Olympic games where India won a medal for Hockey and indicate how many medals were won in each Olympic game.
All questions.sql
: Contains the SQL queries used to solve the problems mentioned above.
To run these queries, follow these steps:
- Install PostgreSQL on your system if not already done.
- Create a database and import the Olympics dataset.
- Open a SQL client (e.g., pgAdmin) and execute the queries in the
queries.sql
file.
This project demonstrates the application of SQL queries on the Olympics dataset to extract valuable insights and answers to specific questions. The queries provide a deeper understanding of the historical Olympic data and showcase the capabilities of SQL for data analysis.