Giter VIP home page Giter VIP logo

portfolio-project-covid-19-analysis-using-sql's Introduction

Portfolio Project: COVID-19 Analysis

This project focuses on analyzing COVID-19 data to gain insights into the impact of the pandemic. It includes SQL queries to retrieve and analyze data related to cases, deaths, vaccination rates, and more.

Getting Started

To run these queries, you need access to the PortfolioProject database. Make sure you have the necessary permissions to execute SQL queries.

Queries

Query 1: Total Cases and Deaths by Continent

This query retrieves the total cases and total deaths for each continent.

SELECT continent, Max(cast(Total_deaths as int)) as TotalDeathCount
FROM PortfolioProject..CovidDeaths
WHERE continent IS NOT NULL
GROUP BY continent
ORDER BY TotalDeathCount DESC

Query 2: Total Cases and Deaths by Country

This query retrieves the total cases and total deaths for each country.

SELECT Location, Max(cast(Total_deaths as int)) as TotalDeathCount
FROM PortfolioProject..CovidDeaths
WHERE continent IS NOT NULL
GROUP BY Location
ORDER BY TotalDeathCount DESC

Query 3: Total Cases and Deaths in United States

This query retrieves the total cases and total deaths in the United States.

SELECT Location, date, total_cases, total_deaths, (CAST(total_deaths AS float) / CAST(total_cases AS float)) * 100 AS DeathPercentage
FROM PortfolioProject..CovidDeaths
WHERE location LIKE '%states%' AND continent IS NOT NULL
ORDER BY Location, date

Query 4: Total Cases vs Population

This query shows the percentage of the population that has been infected by COVID-19.

SELECT Location, date, total_cases, population, (CAST(total_cases AS float) / CAST(population AS float)) * 100 AS InfectionPercentage
FROM PortfolioProject..CovidDeaths
ORDER BY Location, date

Query 5: Countries with Highest Infection Rate to Population

This query identifies the countries with the highest infection rate relative to their population.

SELECT Location, population, Max(total_cases) as HighestInfectionCount, Max((CAST(total_cases AS float) / CAST(population AS float))) * 100 AS PercentagePopulationInfected
FROM PortfolioProject..CovidDeaths
GROUP BY Location, population
ORDER BY PercentagePopulationInfected DESC

Query 6: Total Population vs Vaccinations

This query shows the percentage of the population that has received at least one COVID-19 vaccine.

SELECT dea.continent, dea.location, dea.date, dea.population, vac.new_vaccinations, SUM(CONVERT(int,vac.new_vaccinations)) OVER (PARTITION BY dea.Location ORDER BY dea.location, dea.Date) as RollingPeopleVaccinated
FROM PortfolioProject..CovidDeaths dea
JOIN PortfolioProject..CovidVaccinations vac
ON dea.location = vac.location
AND dea.date = vac.date
WHERE dea.continent IS NOT NULL

Views

PercentPopulationVaccinated

This view stores the data related to the percentage of the population that has been vaccinated against COVID-19. It includes the continent, location, date, population, new vaccinations, and rolling people vaccinated.

CREATE VIEW PercentPopulationVaccinated AS
SELECT dea.continent, dea.location, dea.date, dea.population, vac.new_vaccinations, SUM(CONVERT(int,vac.new_vaccinations)) OVER (PARTITION BY dea.Location ORDER BY dea.location, dea.Date) as RollingPeopleVaccinated
FROM PortfolioProject..CovidDeaths dea
JOIN PortfolioProject..CovidVaccinations vac
ON dea.location = vac.location
AND dea.date = vac.date
WHERE dea.continent IS NOT NULL

Conclusion

These queries and views provide valuable insights into the COVID-19 pandemic, including the total cases and deaths by continent and country, the infection rate relative to population, and the percentage of the population vaccinated. You can use this information to track the impact of the pandemic and make data-driven decisions.

portfolio-project-covid-19-analysis-using-sql's People

Contributors

abdoo50 avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.