-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSQL Project.sql
More file actions
56 lines (48 loc) · 1.06 KB
/
Copy pathSQL Project.sql
File metadata and controls
56 lines (48 loc) · 1.06 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
use shamzy;
select * from covid_data;
# Global Total Cases and Deaths
SELECT
SUM(total_cases) AS total_global_cases,
SUM(total_deaths) AS total_global_deaths
FROM covid_data;
# Top Continents by Total Cases
SELECT
continent,
MAX(total_cases) AS total_cases
FROM covid_data
GROUP BY continent
ORDER BY total_cases DESC
LIMIT 10;
# Continent with Highest Death Rates
SELECT
continent,
MAX(total_deaths) / MAX(total_cases) * 100 AS death_rate_percentage
FROM covid_data
GROUP BY continent
ORDER BY death_rate_percentage DESC
LIMIT 10;
# Vaccination Coverage Analysis
SELECT
continent,
MAX(total_vaccinations) AS vaccination_rate
FROM covid_data
GROUP BY continent
ORDER BY vaccination_rate DESC
LIMIT 10;
# Daily Case Trends by Country
SELECT
date,
SUM(new_cases) AS total_daily_cases
FROM covid_data
WHERE location = 'Afghanistan'
GROUP BY date
ORDER BY date;
# Identifying Peak Case Days
SELECT
date,
country,
MAX(new_cases) AS peak_cases
FROM covid_data
GROUP BY date, location
ORDER BY peak_cases DESC
LIMIT 10;