-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpractica1.sql
57 lines (56 loc) · 1.38 KB
/
practica1.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
# 1
SELECT population FROM world
WHERE name = 'Germany
# 2
SELECT name, population FROM world
WHERE name IN ('Sweden', 'Norway', 'Denmark');
# 3
SELECT name, area FROM world
WHERE area BETWEEN 200000 AND 250000
# 4
SELECT Andorra Europe 468 78115 3712000000
# 5
SELECT name FROM world
WHERE population >=200000000
# 6
SELECT name, gdp/population
FROM world
WHERE population >200000000
# 7
SELECT name country, population/1000000 pop_millions
FROM world
WHERE continent = 'South America'
# 8
SELECT name country, population
FROM world
WHERE name IN ('France', 'Germany', 'Italy')
# 9
SELECT name country
FROM world
WHERE name LIKE '%United%'
# 10
SELECT name, population, area
FROM world
WHERE area > 3000000 OR population > 250000000
# 11
SELECT name, population, area
FROM world
WHERE (area > 3000000 AND population < 250000000)
OR (area < 3000000 and population > 250000000)
# 12
SELECT name, ROUND(population/1000000,2), ROUND(gdp/1000000000, 2)
FROM world
WHERE continent = 'South America'
# 13
SELECT name, ROUND(gdp/population, -3)
FROM world
WHERE gdp > 1000000000000
# 14
SELECT name, capital FROM world
WHERE LENGTH(name) = LENGTH(capital);
# 15
SELECT name, capital FROM world
WHERE LEFT(name, 1) = LEFT(capital, 1) XOR name = capital
# 16
SELECT name FROM world
WHERE name LIKE '%a%' AND name LIKE '%e%' AND name LIKE '%i%' AND name LIKE '%o%' AND name LIKE '%u%' AND name NOT LIKE '% %';