-
Notifications
You must be signed in to change notification settings - Fork 0
/
SQLCurrencyNew.sql
35 lines (27 loc) · 961 Bytes
/
SQLCurrencyNew.sql
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
Select *
From CurrencyProject..GDP
join CurrencyProject..POP
On GDP.[Country Name] = POP.[Country Name]
and GDP.[Country Code] = GDP.[Country Code]
order by 1
Select *, ((GDP.[2021]-GDP.[1961])/60) as [AvgIncrease/Year]
From CurrencyProject..GDP
order by 1
Select *, ((POP.[2021]-POP.[1961])/60) as [AvgPOPIncrease/Year]
From CurrencyProject..POP
order by 1
DELETE FROM GDP WHERE [Country Name]='Country Name'
DELETE FROM GDP WHERE [Country Name]='South Asia';
DELETE FROM POP WHERE [Country Name]='Country Name';
DELETE FROM POP WHERE [Country Name]='South Asia';
Select [Country Name], [2021]
From CurrencyProject..GDP
order by 2 desc
Select [Country Name], [2021]
From CurrencyProject..POP
order by 2 desc
Select GDP.[Country Name], GDP.[2021], POP.[2021], (GDP.[2021]/POP.[2021]) as [GDP Per Capita]
From CurrencyProject..GDP
join CurrencyProject..POP
On GDP.[Country Name] = POP.[Country Name]
order by 4 desc