This SQL project focuses on analyzing a dataset related to life expectancy. The dataset is loaded into BigQuery as a table named "LifeExpectancy," and the project addresses various questions using SQL queries. Key topics covered include GROUP BY, ORDER BY, HAVING, and CASE-WHEN.
The project begins by providing an overview of the dataset's structure to understand the available columns. It then proceeds to answer several questions related to life expectancy and demographic data.
-
Average Life Expectancy in Europe: The project calculates the average life expectancy at birth in Europe, utilizing the numeric variable related to the "MetricObserved" dimension.
-
Lowest Life Expectancy at Birth by Region: It identifies the region with the lowest life expectancy at birth.
-
Highest Life Expectancy at Birth by Region: The project determines which region has the highest life expectancy at birth.
-
Highest Life Expectancy after Age 60: The country with the highest life expectancy after the age of 60 is identified.
-
Pivot Table for Average Life Expectancy: A pivot table is created to display the average life expectancy for different metrics by region. It utilizes GROUP BY and CASE-WHEN to pivot the data.
-
Gender Gap in Life Expectancy at Birth: The project investigates the gender gap in life expectancy at birth, highlighting countries with the largest gaps and potential scenarios where men live longer than women.
-
Top 10 Countries with Highest Life Expectancy at Birth for Both Sexes: It identifies the top 10 countries where life expectancy at birth is highest for both sexes.
-
Life Expectancy at Age 60 by Region and Gender: The project explores life expectancy at age 60 by region and gender.
The SQL project offers insights into various aspects of life expectancy, including regional variations, gender disparities, and more. The provided queries and analyses can be used as a foundation for further exploration and insights into the dataset.