SQLZOO练习笔记-Select from World Tutorial
小白头一次在CSDN上发博客…这个系列主要是想记录一下自己的DQLZOO练习,也希望大家不吝赐教~哪里写错了或者有更好的方法还请多多指教啦。?
题目不打出来了,而且做了几套题之后我发现这网站有时候原题目和答案表格所暗示的题目不一样,所以可能对于想借鉴答案的朋友们来说没啥参考性了…看个思路就好。
SELECT name, continent, population FROM world
SELECT name FROM world
WHERE population > 200000000
select name, gdp/population from world
where population > 200000000
select name, population/1000000 from world
where continent = ‘South America’
select name, population from world
where name in (‘France’, ‘Germany’,‘Italy’)
select name from world
where name like ‘%United%’
select name, population, area from world
where area > 3000000 or population > 250000000
select name, population, area from world
where (area > 3000000 and population <= 250000000)
or (area <= 3000000 and population > 250000000)
select name, round(population/1000000,2), round(gdp/1000000000,2) from world>select name, round(population/1000000,2), round(gdp/1000000000,2) from world
where continent = ‘South America’
select name, round(gdp/population, -3) from world>select name, round(gdp/population, -3) from world
where gdp > 1000000000000
SELECT name, capital from world
where length(name) = length(capital)
SELECT name, capital
FROM world
where left(name,1) = left(capital,1)
and name <> capital
SELECT name FROM world
WHERE if(locate(‘a’,name), 1, 0)+if(locate(‘e’,name), 1, 0)+if(locate(‘i’,name), 1, 0)+if(locate(‘o’,name), 1, 0)+if(locate(‘u’,name), 1, 0) = 5
and locate(’ ',name) = 0