-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path4 Select within Select
More file actions
35 lines (28 loc) · 998 Bytes
/
4 Select within Select
File metadata and controls
35 lines (28 loc) · 998 Bytes
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
1. List each country name where the population is larger than that of 'Russia'.
SELECT name FROM world
WHERE population >
(SELECT population FROM world
WHERE name='Russia')
2. Show the countries in Europe with a per capita GDP greater than 'United Kingdom'.
SELECT name FROM world
WHERE continent = "Europe" and
gdp/population >
(SELECT gdp/population FROM world
WHERE name='United Kingdom')
3. List the name and continent of countries in the continents containing either Argentina or Australia. Order by name of the country
SELECT name, continent
FROM world
WHERE continent IN
(SELECT continent
FROM world
WHERE name='Australia' OR name='Argentina')
order by name
4. Which country has a population that is more than Canada but less than Poland? Show the name and the population.
SELECT name, population
FROM world
WHERE population >
(SELECT population FROM world
WHERE name = 'Canada') and
population <
(SELECT population FROM world
WHERE name = 'POLAND')