-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathCountries.sql
More file actions
49 lines (39 loc) · 1.56 KB
/
Copy pathCountries.sql
File metadata and controls
49 lines (39 loc) · 1.56 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
Select * countries
Where languages = 'Slovene'
Group By desc language percentage
SELECT countries.name, languages.language, languages.percentage
FROM countries
LEFT JOIN languages ON countries.id = languages.country_id
WHERE languages.language = 'Slovene'
ORDER BY languages.percentage DESC;
Select countries.cities
Select countries.name Count(cities.id) As cities_num
From countries
Join cities On countries.id = cities.country_id
Group by cities_num DESC
Select countries.name, cities.population, cities.name
From countries
Left Join cities On countries.id = cities.country_id
Where country.id = 'Mexico' And cities.population > 500000
Order by cities.population DESC
Select countries.name, languages.language, language.percentage
From countries
Left Join languages On countries.id = languages.country_id
Where languages.percentage > 89
Order by languages.percentage DESC
Select countries.name, countries.surface_area, countries.population
From countries
Where countries.surface_Area > 501 And countries.population < 100,000
Select countries.government_form, countries.capital, countries.life_expectancy
From countries
Where government_form = Constitutional_Monarchy And life_expectancy > 75 And capitol > 200
Select countries.name, cities.district, countries.name, cities.population
From countries
LEFT JOIN cities ON countries.id = cities.country_id
Where country.name = 'Argentina'
And cities.district = 'Buenos Ares'
And cities.population > 500,000
Select countries.region, Count(countries.id) as countryNumber
From countries
Group by countries.region
Order by countryNumber DESC