In the world of Data Science, SQL is critical for data extraction, manipulation, and analysis. In this article, I will present a case study in which I used SQL to analyze a historical dataset from the Olympic Games.
This case study highlights how using SQL (and Python) for data analysis allows for discovering trends and insights of particular statistical interest.

The case study is based on historical data from the Olympic Games to uncover trends and insights that could shed light on the evolution of the games and the athletes participating in them. Initial hypotheses were related to the correlation between athletes’ height and weight, the trend of female participation, and the distribution of Body Mass Index (BMI).
The approach to data analysis was a combination of SQL and Python, leveraging both strengths to extract, clean, and analyze data. Several technical challenges were faced during the analysis, including missing data, inconsistent data, a large dataset, and complex SQL queries.
The analysis results confirmed the initial hypotheses, showing a positive correlation between athletes’ height and weight and an increasing trend in female participation over time. These results provide valuable insights into trends and patterns of Olympic participation, highlighting the importance of considering multiple factors, such as gender and physical characteristics, in the analysis.
This case study demonstrates how using SQL and other data analysis tools can lead to significant discoveries and valuable insights. As a data analyst, the ability to use SQL to extract and manipulate data is critical, and this case study highlights the effectiveness of these skills in a practical context.
1. Introduction and Hypotheses
Our analysis is based on the historical data of the Olympic Games. We aimed to uncover interesting trends and insights that could shed light on the evolution of the games and the athletes participating in them.
Our initial hypotheses were:
1.1 Correlation between Height and Weight: We aimed to uncover interesting trends and insights that could shed light on the evolution of the games and the athletes participating in them. This is based on the general understanding that taller individuals tend to weigh more due to their larger body mass.
1.2 Trend in Female Participation: We hypothesized that the participation of female athletes in the Olympic Games has increased over time. This is based on the global trend towards gender equality and increased opportunities for women in sports.
1.3 Body Mass Index (BMI) Distribution: We hypothesized that athletes’ BMI would be within the normal range, given the physical demands of competitive sports and the emphasis on fitness and health.
In the following slides, we will discuss the approach we took to test these hypotheses and the insights we discovered.
2. Data Analysis Approach
Our data analysis approach combined SQL and Python, leveraging both strengths to extract, clean, and analyze the data.
2.1 Data Extraction: We used SQL to extract the relevant data from the Olympic Games dataset. This included details about the athletes, the events they participated in, and their performance.
2.2 Data Cleaning: We cleaned data using SQL and Python. This involved handling missing values, removing duplicates, and ensuring the data types were correct for our analysis.
2.3 Data Analysis: We used Python, specifically the panda’s library, for our data analysis. This allowed us to manipulate the data efficiently and perform statistical analysis. We tested our hypotheses by calculating correlations, creating visualizations, and performing trend analysis.
2.4 Data Visualization: We used Python libraries, including matplotlib and seaborn, to create visualizations that helped us understand the data better and uncover insights.



In the following steps, we will present the results of our analysis and the insights we discovered.
3. Technical Challenges
During our analysis, we encountered several technical challenges that we had to overcome:
3.1 Missing Data: Some of the records in the dataset had missing values, particularly in the height and weight fields. This posed a challenge as these were critical fields for our analysis. We addressed this by excluding these records from specific analyses where these fields were crucial.
3.2 Inconsistent Data: We found some inconsistencies in the data, such as variations in the naming conventions for the Olympic Games (e.g., ‘Summer’ vs. ‘S’). We addressed this by standardizing the data to ensure consistency.
3.3 Large Dataset: The dataset was large, with over 270,000 records. This posed a challenge in terms of computational resources. We addressed this by performing efficient SQL queries to extract only the necessary data for our analysis.
3.4 Complex Queries: Some of our analyses required complex SQL queries, such as calculating the correlation between height and weight. We addressed this by breaking down the queries into smaller, manageable parts and testing each part before combining them.

4. Entity Relationship Diagram (ERD)
ERD to illustrate the relationships between different entities in the dataset.

The diagram represents the following relationships:
- An ATHLETE participates in a PARTICIPATION.
- A PARTICIPATION occurs in an EVENT during an OLYMPICS.
- An ATHLETE is a TEAM member representing the NOC (National Olympic Committee).
- An EVENT is of a specific SPORT.
- An OLYMPICS occurs in a SEASON and is hosted by a CITY.
5. Initial Findings
In our initial analysis, we explored the dataset to understand the general characteristics of the athletes and the Olympic Games. Here are some of our key findings:
5.1 Athlete’s Physical Characteristics: We found that the average height of athletes is approximately 175.34 cm, and the average weight is around 70.70 kg. These values, however, vary significantly across different sports.
5.2 Sports Participation: We discovered that Athletics, Gymnastics, and Swimming are the sports with the highest number of athletes participating. This is likely due to the large number of events within these sports.
5.3 Country Participation: We observed that the United States, France, and Great Britain have the highest number of athletes participating in the Olympic Games. This could be due to these countries’ long history in the Games and their large population sizes.
5.4 Female Participation: We noticed a significant increase in the percentage of female athletes over time. In the early years of the Olympic Games, female participation was meager, but it has been steadily increasing and is now close to parity with male participation.

These initial findings gave us a good understanding of the dataset and helped guide our further analysis.
6. Deeper Analysis
In our deeper analysis, we focused on two main areas: the correlation between an athlete’s height and weight and the trend in female participation over time. Here are our findings:
6.1 Correlation between Height and Weight: We found a positive correlation between an athlete’s height and weight, with a correlation coefficient of approximately 0.66. This suggests that taller athletes tend to be heavier, which is expected given that height and weight are generally related to human body structure. However, this correlation may vary across different sports due to the specific physical demands of each sport.
6.2 Trend in Female Participation: Our analysis showed a clear upward trend in the percentage of female athletes over time. In the early years of the Olympic Games, female participation was meager, but it has steadily increased. By the 2016 Rio Games, female participation had reached nearly 45%, indicating significant progress toward gender equality in the Olympics.
These deeper insights provide a more nuanced understanding of the data and highlight significant trends and relationships.
We have already discussed the trend in female participation in the initial results, showing a significant increase over time. To provide a clearer picture of this trend, we can create a graph showing the percentage of female athletes in each Olympic Games edition.

As can be seen, women’s participation has increased significantly over time. In the early years of the Olympic Games, female participation was meager, but it has steadily increased. This is an essential indicator of progress toward gender equality in the Olympic Games.
7. Hypotheses Results
Our initial hypotheses were centered around the relationship between an athlete’s physical characteristics (height and weight), their participation in the Olympic Games, and the trend in female participation over time. Here are the results:
7.1 Correlation between Height and Weight: The data supported our hypothesis that an athlete’s height and weight would have a positive correlation. We found a correlation coefficient of approximately 0.66, indicating a moderate positive correlation. This suggests that, on average, taller athletes tend to be heavier. However, it’s important to note that this correlation may not hold for all sports, as different sports have different physical demands and ideal body types.
7.2 Trend in Female Participation: The data also supported our hypothesis that female Olympics participation has increased over time. We found a clear upward trend in the percentage of female athletes participating in the Games. In the early years of the Olympics, female participation was meager, but it has been steadily increasing over the decades. By the 2016 Rio Games, female participation had reached nearly 45%, indicating significant progress toward gender equality in the Olympics.
These results provide valuable insights into the trends and patterns in Olympic participation, and they highlight the importance of considering multiple factors, such as gender and physical characteristics, in our analysis.
8. Conclusion and Recommendations
Our analysis of the Olympic Games dataset has yielded several key insights:
8.1 Correlation between Height and Weight: A moderate positive correlation exists between an athlete’s height and weight. This suggests that physical characteristics can significantly influence an athlete’s suitability for specific sports. Coaches and trainers might consider this when guiding young athletes toward sports where their physical attributes may give them an advantage.
8.2 Increasing Female Participation: A clear upward trend in female participation in the Olympics has occurred. This is a positive sign of increasing gender equality in sports. However, with female participation still not on par with male participation, more work must be done. Sports organizations and committees might focus on promoting and supporting female athletes and work towards creating more opportunities for women in sports.
8.3 Body Mass Index (BMI) Analysis: The analysis of athletes’ BMI across different sports can provide insights into the physical demands of each sport. This could be helpful information for athletes and coaches in training and preparation.

This graph shows each sport’s average body mass index (BMI). This can provide insights into the physical demands of each sport.
In conclusion, data analysis provides valuable insights that can help us understand trends and patterns in sports and inform strategies for athlete training, performance, and promoting gender equality in sports. As we move forward, it will be essential to continue analyzing and learning from the data to support the growth and evolution of the Olympic Games.