1. select name from world where population > (select population from world where name = 'Russia');2.select name from world
where continent = 'Europe' and gdp/population >
(select gdp/population from world where name = 'United Kingdom')3.select name,continent from world where continent in
(select continent from world
where name in ('Argentina','Australia') )
order by name;4.select name, population from world where population > (select population from world where name = 'Canada') and population < (select population from world where name = 'Poland');5.select name, concat(round(population/(select population from world where name = 'Germany')*100), '%')from world where continent = 'Europe';6.select name from world
where gdp > all
(select gdp from world
where continent = 'Europe' and gdp>0);7.select continent, name, area from world as s1 where area >=all
(select max(area) from world as s2
where s1.continent = s2.continent
group by continent );8. List each continent and the name of the country that comes first alphabetically.
select continent, name from world as s1
where name <= all (select min(name) from world as s2
where s1.continent = s2.continent
group by continent);
// 通過比較找最值-----比所有都大/小--->最大最小。
第一步: 找出所有集合B
第二步: where條件---A>= all(B) A是最大; A<=B A是最小
// 按什么劃分,where后面就用什么關聯
//where同樣有按continent劃分的功能, 這里的group by continent可略
// 用>all <all 表示最大,最小9.select name, continent,population from world as s1
where 25000000 >= all
(select population from world as s2 where s1.continent = s2.continent)10. Some countries have populations more than three times that of any of their neighbours (in the same continent). Give the countries and continents.
select name, continent from world as s1 where population > all
(select population*3 from world as s2
where s1.continent = s2.continent and s1.name != s2.name )
用 A != B 表示AB可互相鄰