08 / 09Public health · SQL2024

World Life Expectancy

A SQL cleaning and exploration project examining life expectancy, GDP, development status, BMI, and adult mortality worldwide.

World Life Expectancy project cover
15 yearschange measured by country
$1,500high-GDP comparison threshold
2 groupsdevelopment status comparison
Annualglobal trend view

The question

Prepare a multi-year global health dataset and investigate the economic and demographic factors associated with life expectancy.

The approach

I removed duplicate country-year rows, restored missing development status, interpolated incomplete life-expectancy values using adjacent years, and created trend, comparison, and rolling calculations.

The outcome

The finished analysis measures fifteen-year changes, compares GDP and development groups, and connects life expectancy with economic and health indicators.

Analysis questions

What the work needed to answer.

  1. 01

    Which country-year records are duplicated or incomplete?

  2. 02

    How much did life expectancy change over fifteen years by country?

  3. 03

    How do GDP and development status relate to life expectancy?

  4. 04

    What do BMI and rolling adult mortality reveal?

Method

From raw data to a useful answer.

01

Deduplicate

Partitioned by country and year to isolate repeated records.

02

Restore dimensions

Used self joins to fill missing developed or developing status from other records for the same country.

03

Interpolate values

Estimated missing life expectancy from the preceding and following years where both were available.

04

Analyze trends

Calculated country change, yearly averages, GDP groups, development comparisons, BMI relationships, and rolling adult mortality.

Results

What the analysis revealed.

01

Cleaning protects every comparison

Duplicate country-year rows and missing status values can materially distort yearly and development-group averages.

02

Adjacent years can repair gaps

For isolated missing life-expectancy values, neighboring years provide a transparent interpolation method.

03

Economic context is visible

A high-versus-low GDP comparison makes the relationship between resources and life expectancy easier to interpret.

04

Windows reveal accumulation

Rolling adult mortality shows how mortality builds over time within a country rather than as disconnected annual values.

Next projectIMDB Top 250 Scrape