top of page

COVID-19 Data Exploration and Insights

  • Writer: Ekramul Haque Towsif
    Ekramul Haque Towsif
  • Sep 15, 2024
  • 1 min read

This SQL script consists of queries used to explore and analyze COVID-19 data. It includes tasks such as filtering, aggregation, and preparing the data for visualizations in order to gain insights into the trends, impacts, and patterns of the pandemic. Link to Code:


Let's have a look at the data first:

ree

Next, we tried to understand the distribution of COVID-19 cases and deaths in different locations and over time


select location, date,  total_cases, new_cases, total_deaths, population
from coviddeaths
order by 3,4;

Output:

ree










Then we calculated the death percentage relative to total cases to understand the severity of the pandemic in various locations:

select location, date,  total_cases, total_deaths,(total_deaths/total_cases)*100 as death_percentage
from coviddeaths
order by 5 desc;

Output:

ree










We also tried to find the locations with the highest infection rates and highest death counts to focus on the most impacted regions.

select location, population,  max(total_cases) as HighestInfectionCount,max(total_deaths/total_cases)*100 as death_percentage
from coviddeaths
group by location, population
order by death_percentage desc;

Output:


ree











Then we aggregated global data to compare the total number of cases and deaths across continents and calculate global death percentages.

select continent, location, date, new_vaccinations, sum(new_vaccinations) over (partition by location order by location,date)
from covidvaccinations
where continent is not null
order by 2,3;

Output:

ree









Finally, we analyzed the rolling vaccination numbers to understand the progress of vaccination efforts in various locations.

with PopsVac (Continent, Loacation, Date, New_Vaccination, RollingPeopleVacccinated) as
(

select continent, location, date, new_vaccinations, sum(new_vaccinations) over (partition by location order by location,date)
from covidvaccinations
where continent is not null
)
select *, (New_vaccination/RollingPeopleVacccinated)*100
from PopsVac;

Output:

ree

 
 
 

Comments


bottom of page