
​​
Life Expectancy Analysis Using SQL
​​​​​​​
Link to database: Click here​
​
Objective:
Analyze global life expectancy trends and their correlations with socioeconomic factors using SQL. The project involves cleaning and exploring the provided dataset to extract meaningful insights.
​​​​
Tools Used:
MySQL
​​​​
Process:
​
Step 1: Data Cleaning
The data cleaning process involved identifying and removing duplicate rows to ensure that each country-year combination was represented only once.
​
​
​
​
​
Missing data in key columns were filled systematically:
For the "Status" column, the classification of "Developed" or "Developing" was found using data from other rows corresponding to the same country.
For the "Life Expectancy" column, missing values were estimated using the average of the preceding and following years for the same country, ensuring the dataset was complete and consistent for further analysis.
Finally, I validated data consistency and ensured all entries were complete and accurate.
​​​​​​​​​​Step 2: Exploratory Data Analysis​
​
Life Expectancy Trends:
- Identified countries with the highest and lowest life expectancy improvements.
- Determined the average life expectancy per year to identify the best-performing years.
​
GDP Correlation:
- Observed a positive correlation between higher GDP and longer life expectancy.
- Segregated countries into high- and low-GDP groups and calculated average life expectancy for each group.
​
​
​​​​​
​
Other Factors:
- Investigated the relationship between BMI, adult mortality, and life expectancy, identifying notable trends.​​​​​
​​​
Key Results:
The analysis revealed that certain countries demonstrated remarkable increases in life expectancy over time.
A positive correlation was observed between GDP and life expectancy, with countries having GDPs above $1,500 averaging a life expectancy of 74 years, compared to 64 years for those below this threshold.
Additionally, higher BMI values were found to be positively associated with longer life expectancy, likely reflecting better access to food in wealthier nations.
​​​​​​​
​​​

