|

Exploration of Covid-19 Data Using SQL

Context

The COVID-19 pandemic, also known as the coronavirus pandemic, is an ongoing global pandemic of coronavirus disease 2019 (COVID-19) caused by severe acute respiratory syndrome coronavirus 2 (SARS-CoV-2). The novel virus was first identified from an outbreak in Wuhan, China, in December 2019. Attempts to contain it failed, allowing the virus to spread to other areas of Asia and later worldwide. The World Health Organization (WHO) declared the outbreak a public health emergency of international concern on 30 January 2020 and a pandemic on 11 March 2020. As of 27 October 2022, the pandemic had caused more than 629 million cases and 6.58 million confirmed deaths, making it one of the deadliest in history.

Questions

To gain insights into the Covid-19 pandemic, the following questions will be answered;

  • What is the likelihood of dying from Covid in Denmark?
  • What is the likelihood of contracting Covid in Denmark?
  • What are the top 5 countries with the highest Covid infection rate in the world?
  • What are the top 5 countries with the highest death count from Covid infection worldwide?

Data Acquisition

The data used for this exploration was acquired from https://ourworldindata.org on 8th October 2022.

SQL Operations in BigQuery

Q1: What is the likelihood of dying from Covid in Denmark?

SELECT Location, date, total_cases, new_cases, total_deaths, population
FROM Covid.Deaths
ORDER BY 1,2;

-- compare total cases and total deaths to show the likelihood of dying from Covid in Denmark
WITH likelihood AS(
SELECT Location, date, total_cases,total_deaths, ((total_deaths/total_cases)*100) AS Percentage_Death
FROM Covid.Deaths
WHERE location LIKE '%Denmark%'
AND continent IS NOT NULL
ORDER BY 1,2 DESC
)
SELECT  ROUND(AVG(Percentage_Death), 2) AS Percentage_Death_Denmark
FROM likelihood;

There is 1.40% likelihood of dying from Covid-19 infection in Denmark.

Q2: What is the likelihood of contracting Covid in Denmark?

WITH likelihood_infected AS(
SELECT Location, date, total_cases, Population, ((total_cases/Population)*100) AS Percentage_Infected
FROM Covid.Deaths
WHERE location LIKE '%Denmark%'
AND continent IS NOT NULL
ORDER BY 1,2 DESC
)
SELECT  ROUND(AVG(Percentage_Infected), 2) AS Percentage_Infected_Denmark
FROM likelihood_infected;

There is 16.58% likelihood of contracting Covid-19 infection in Denmark.

Q3: What are the top 5 countries with the highest Covid infection rate in the world?

-- Identify countries with the highest infection rate
SELECT Location, MAX(total_cases) AS Highest_Infection_Count, Population, (MAX((total_cases/Population))*100) AS Percentage_Population_Infected
FROM Covid.Deaths
GROUP BY Location, Population
ORDER BY Percentage_Population_Infected DESC
LIMIT 5;
LocationPopulationPercentage_Population_Infected
Cyprus89600765.93508756
Faeroe Islands5288865.53093329
San Marino3374662.23552421
Gibraltar3267061.50902969
Austria892208258.57622694

Q4: What are the top 5 countries with the highest death count from Covid infection worldwide?

--Identify countries with the highest death count
SELECT Location, MAX(total_deaths) AS Total_Death_Count
FROM Covid.Deaths
GROUP BY Location, Population
ORDER BY Total_Death_Count DESC
LIMIT 5;
LocationTotal_Death_Count
United States1062513
Brazil686706
India528778
Russia380151
Mexico330202

Similar Posts