From bdf2975fa70b39498d8f2cdaf86bd28c4b7647d6 Mon Sep 17 00:00:00 2001 From: anusoosanbaby Date: Fri, 1 Mar 2024 20:17:49 -0800 Subject: [PATCH] Fix continent with max death count query For continent with highest death count ,the query was incorrectly showing the death count for the country which has maximum death in that continent. This PR fixes the query to show the continent with maximum death. Death in each continent is calculated by summing the new deaths for each day. --- COVID Portfolio Project - Data Exploration.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/COVID Portfolio Project - Data Exploration.sql b/COVID Portfolio Project - Data Exploration.sql index 437a7b8..cc3ecbd 100644 --- a/COVID Portfolio Project - Data Exploration.sql +++ b/COVID Portfolio Project - Data Exploration.sql @@ -62,7 +62,7 @@ order by TotalDeathCount desc -- Showing contintents with the highest death count per population -Select continent, MAX(cast(Total_deaths as int)) as TotalDeathCount +Select continent, SUM(cast(new_deaths as int)) as TotalDeathCount From PortfolioProject..CovidDeaths --Where location like '%states%' Where continent is not null