select name,round(population/1000000,2)as population,round(gdp/1000000000,2) as GDP from world where continent='South America' 10.查询万亿元国内生产总值国家的人均国内生产总值,四捨五入到最近的$ 1000。 select name,round(gdp/population,-3) from world where gdp>1000000000000 11.希腊有首都雅典。 ...
SELECTname,continent ,CASEWHENcontinent='Oceania'THEN'Australasia'WHENcontinentIN('Eurasia','Turkey')THEN'Europe/Asia'WHENcontinent='Caribbean'ANDnameLIKE'B%'THEN'North America'WHENcontinent='Caribbean'THEN'South America'ELSEcontinentENDFROMworldORDERBYname; sqlzoo - SELECT from WORLD练习网址:https://s...
SELECT name, population FROM world WHERE name IN ('France', 'Germany', 'Italy'); /* in运算符是or的简单用法, 也可以使用or语句写成下面的形式。 */ SELECT name, population FROM world WHERE name = 'France' OR name = 'Germany' OR name = 'Italy'; 题目6:显示包含单词“United”为名称的国家...
SELECTname,capitalFROMworldwhereleft(name,1)=left(capital,1)and name<>capital Equatorial Guinea and Dominican Republic have all of the vowels (a e i o u) in the name. They don't count because they have more than one word in the name. Find the country that has all the vowels and no...
SELECTname,capitalFROMworldwhereLEFT(name,1)=LEFT(capital,1)andname<>capital; 赤道几内亚Equatorial Guinea和多米尼加共和国Dominican Republic的名字中包含所有元音(a e i o u)。它们不算,因为它们的名字里有一个以上的单词。 找出名字中包含所有元音且没有空格的国家。
1. 要显示所有国家的名称、大洲和人口,首先阅读WORLD表的注释,执行相应的SQL命令:2. 使用WHERE子句筛选出人口超过2亿的国家,命令为:SELECT name FROM WORLD WHERE population >= 200000000;3. 计算人均GDP(GDP / 人口)并筛选出人口至少2亿的国家,查询为:SELECT name, GDP / population AS avg...
selectname,populationfromworldwherenamein('France','Germany','Italy'); 6. Show the countries which have a name that includes the word 'United' selectnamefromworldwherename like'%United%'; 7. Two ways to be big: A country is big if it has an area of more than 3 million sq km or ...
SELECT from WORLD Tutorial 1.Observe the result of running this SQL command to show the name, continent and population of all countries. SELECT name,continent,population FROM world # 选择多个属性时,每个属性必须用逗号隔开 2.Show the name for the countries that have a population of at least 200...
SQLZOO:SELECT from WORLD Tutorial/zh 1.观察运行一个简单的 SQL 命令的结果 SELECTname,continent,populationFROMworld; 2.显示至少具有 2 亿人口的国家名称(2 亿是 200000000,有八个零) SELECTnameFROMworldWHEREpopulation>=200000000; 3.找出至少有 2 亿人口的国家名称,及人均国内生产总值 ...
题目链接:https://sqlzoo.net/wiki/SELECT_from_WORLD_Tutorial 1 selectname,continent,populationfromworld 2 selectnamefromworldwherepopulation>200000000 3 selectname,gdp/populationfromworldwherepopulation>200000000 4 selectname,population/1000000fromworldwherecontinent='South America' ...