select name, round(gdp/population,-3) from world where population >= 1000000000000; 【解析】round,第2个参数为正数时,表示保留几位小数;如果为负数时,表示取几位数字; 10. Greece has capital Athens. Each of the strings 'Greece', and 'Athens' has 6 characters. Show the name and capital where...
SELECTname,ROUND(gdp/population/1000)*1000FROMworldWHEREgdp>1000000000000 11.显示以N开头的国家名字,但是将Oceania替换成Australasia SELECTname,CASEWHENcontinent='Oceania'THEN'Australasia'ELSEcontinentENDFROMworldWHEREnameLIKE'N%' 12.显示以A或B开头的国家名字,大洲,但是将Europe和Asia替换成Eurasia,将在North A...
SELECTname,continent,CASEWHENcontinentIN('Eurasia','Turkey')THEN'Europe/Asia'WHENcontinent='Oceania'THEN'Australasia'WHENcontinent='Caribbean'THENCASEWHENnameLIKE'B%'THEN'North America'ELSE'South America'ENDELSEcontinentENDFROMworldORDERBYnameASC; 这个就有点难度了,感觉有点费脑,嵌套了2层。。 测试题 ...
1、select name,continent,population from world 2、select name from world where population>200000000 3、select name,gdp/population from world where population>200000000 4、select name,population/1000000 from world where continent like 'south america' 5、select name,population from world where name in ...
SELECT name, ROUND(population/1000000,2), ROUND(gdp/1000000000,2) FROM world where continent = 'South America' 10.顯示國家有至少一個萬億元國內生產總值(萬億,也就是12個零)的人均國內生產總值。四捨五入這個值到最接近1000。 顯示萬億元國家的人均國內生產總值,四捨五入到最近的$ 1000。
SELECTname,areaFROMworldWHEREareaBETWEEN200000AND250000; 二、SELECT from world 1、显示所有国家的名称,所在大洲,人口 Observe the result of running this SQL command to show the name, continent and population of all countries. SELECTname,continent,populationFROMworld; ...
SELECTnameFROMworldWHEREnameLIKE'%United%' 7.Two ways to be big Two ways to be big: A country is big if it has an area of more than 3 million sq km or it has a population of more than 250 million. Show the countries that are big by area or big by population. Show name, popula...
Select * from World Mar 19. 2009 @rasmus Rasmus' Toys Blog Select * from WorldMar 19. 2009 I have been having a lot of fun with two Yahoo! technologies that have been evolving quickly. YQL and GeoPlanet. The first, YQL, puts an SQL-like interface on top of all the data on ...
SELECTnameFROMworldWHEREnameLIKE'Y%' 2.找出以 Y 為結尾的國家 代码语言:javascript 复制 SELECTnameFROMworldWHEREnameLIKE'%Y' 3.找出所有國家,其名字包括字母x “Luxembourg 盧森堡”中有一個x字母,還有一個國家的名字中有x。列出這兩個國家。 代码语言:javascript ...
SELECT s, arr FROM arrays_test ARRAY JOIN arr; 结果集: ┌─s─────┬─arr─┐│ Hello │ 1││ Hello │ 2││ World │ 3││ World │ 4││ World │ 5│└───────┴─────┘ JOIN子句 JOIN语句用于根据特定的关联条件,将两个或多个表中的行进行组合,以构建更为复杂且...