【SQL】9.SQLZOO练习4--SELECT from SE
2017-06-05 本文已影响97人
一曈
题目链接:https://sqlzoo.net/wiki/SELECT_within_SELECT_Tutorial

select name from world
where population > (select population from world where name='Russia')

select name from world
where gdp/population >
(select gdp/population from world where name='United Kingdom')
and continent = 'Europe'

select name,continent from world
where continent in
(select continent from world where name in ('Argentina','Australia'))
order by name

select name,population from world
where population >
(select population from world where name='Canada')
and
population < (select population from world where name='Poland')

select name,concat(round(population*100/(select population from world
where name='Germany' ) ,0),'%') from world
where continent='Europe'


select name from world
where gdp > (select max(gdp) from world
where continent='Europe')

select continent,name,area from world x
where area >= ALL
(select area from world y
where y.continent=x.continent
and area >0)

SELECT continent, MIN(name) AS name
FROM world
GROUP BY continent
ORDER by continent

select name,continent,population from world x
where 25000000>=all
(select population from world y
where y.continent=x.continent)

select name,continent from world x
where x.population/3 >= all
(select population from world y
where y.continent=x.continent
and y.name!=x.name)