-
Notifications
You must be signed in to change notification settings - Fork 0
/
CIMINO6.sql
61 lines (52 loc) · 1.24 KB
/
CIMINO6.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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
-- 36
-- select sum(p.Population),
-- max(p.Population), min(p.Population), avg(p.Population),
-- count(p.Population)
-- from Country p;
-- 37
-- select p.Continent,
-- sum(p.Population), max(p.Population), min(p.Population), avg(p.Population)
-- from Country p
-- group by p.Continent;
-- 38
-- select Continent,
-- count(Name) from country
-- group by Continent;
-- 39
-- select countrycode as country,
-- sum(population) from city
-- group by countrycode;
-- 40
-- select Language,Percentage
-- from countrylanguage
-- GROUP BY language;
-- 41
-- select GovernmentForm ,
-- avg(population) from country
-- where Continent like 'Europe'
-- group by GovernmentForm;
-- 42
-- select Region,
-- max(LifeExpectancy) from country
-- group by Region
-- order by LifeExpectancy asc
-- limit 10;
-- 43
-- select District, Population,
-- count(Name) from city
-- where population > 500000
-- group by District
-- order by count(Name) desc
-- limit 10;
-- 44
-- select p.Name,
-- count(c.Name) from city c
-- join country p on c.CountryCode=p.Code
-- where p.Region like 'Caribbean'
-- group by p.Name ;
-- 45
-- select l.Language,
-- count(p.Name) from country p
-- join countryLanguage l on p.Code=l.CountryCode
-- where p.Code=l.CountryCode
-- group by l.Language;