日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 运维知识 > 数据库 >内容正文

数据库

SQLZOO:SELECT within SELECT Tutorial

發布時間:2024/1/18 数据库 35 豆豆
生活随笔 收集整理的這篇文章主要介紹了 SQLZOO:SELECT within SELECT Tutorial 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

1.List each country name where the population is larger than that of ‘Russia’.

world(name, continent, area, population, gdp)

SELECT name FROM world WHERE population > (SELECT population FROM worldWHERE name='Russia')

2.Show the countries in Europe with a per capita GDP greater than ‘United Kingdom’.

Per Capita GDP
The per capita GDP is the gdp/population

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

3.List the name and continent of countries in the continents containing either Argentina or Australia. Order by name of the country.

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

4.Which country has a population that is more than Canada but less than Poland? Show the name and the population.

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

5.Germany (population 80 million) has the largest population of the countries in Europe. Austria (population 8.5 million) has 11% of the population of Germany.

Show the name and the population of each country in Europe. Show the population as a percentage of the population of Germany.

The format should be Name, Percentage for example:

namepercentage
Albania3%
Andorra0%
Austria11%

Decimal places
You can use the function ROUND to remove the decimal places.
Percent symbol %
You can use the function CONCAT to add the percentage symbol.

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

6.Which countries have a GDP greater than every country in Europe? [Give the name only.] (Some countries may have NULL gdp values)

select name from world where gdp > all(select gdp from world where continent='Europe'and gdp>0);

7.Find the largest country (by area) in each continent, show the continent, the name and the area:

SELECT continent, name, area FROM world as x WHERE area >= ALL(SELECT areaFROM world yWHERE y.continent=x.continentorder by continentAND area>0);

8.List each continent and the name of the country that comes first alphabetically.

select continent,name from (select continent,name, row_number() over(partition by continent order by name)as afrom worldorder by continent) as newtable where newtable.a=1; select continent,name from world x where x.name=(select y.name from world y where y.continent=x.continent order by name limit 1); select continent, name from world a where name <= all(select name from world b where a.continent=b.continent)

9.Find the continents where all countries have a population <= 25000000. Then find the names of the countries associated with these continents. Show name, continent and population.

select name,continent,population from world a where 25000000>ALL(select population from world b where a.continent=b.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 a where (a.population/3)>=all(select population from world b where a.continent=b.continent and a.name<>b.name and b.population>0);

總結

以上是生活随笔為你收集整理的SQLZOO:SELECT within SELECT Tutorial的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。

主站蜘蛛池模板: 亚洲高清视频免费观看 | 欧美性猛交xx乱大交 | 欧美日韩在线视频免费播放 | 日本三级少妇 | 国产精品一区麻豆 | 亚洲va韩国va欧美va | 欧美日韩人妻精品一区 | 师生出轨h灌满了1v1 | 久久电影一区二区 | 国产精品久久影院 | jizzjizz欧美69巨大 | 色呦呦在线观看视频 | 毛片在线免费播放 | 超碰2019| 韩国女主播裸体摇奶 | 中文字幕国产亚洲 | 日韩精品人妻中文字幕 | 人妻换人妻a片爽麻豆 | 伊人国产视频 | 噜噜狠狠狠狠综合久久 | 自拍偷拍电影 | 国产91成人| 中文一区视频 | 女人被狂躁c到高潮喷水电影 | 日本一区二区在线视频 | 国产日产精品一区二区三区 | 久久久无码精品亚洲国产 | 亚洲性色av | 日本黄色免费视频 | 99reav | 免费高清成人 | 双腿张开被9个男人调教 | 黄床大片| 手机看片日韩欧美 | 成片免费观看 | 帮我拍拍漫画全集免费观看 | 91成人短视频在线观看 | 99国产精品99久久久久久 | 免费 成 人 黄 色 | 欧美毛片基地 | 一区二区三区四区影院 | 夜夜嗨aⅴ一区二区三区 | 欧美福利视频一区二区 | 午夜精品一区二 | 久久亚洲精品国产精品黑人v | 国产一区中文 | 欧美黄色性视频 | www国产在线 | 日日噜噜噜夜夜爽爽狠狠视频97 | 成人三区| 奇米888一区二区三区 | 奇米精品一区二区三区在线观看一 | 免费成人黄| 国产 欧美 自拍 | 精品一区二区三区免费 | 麻豆乱码国产一区二区三区 | 色欲亚洲Av无码精品天堂 | 国产成人综合视频 | 国产福利小视频在线 | 欧美高清免费 | 大陆女明星乱淫合集 | 欧洲中文字幕日韩精品成人 | 精品国产av 无码一区二区三区 | 九九综合| 麻豆高清免费国产一区 | 国产伦一区二区三区 | 制服中文字幕 | 97se亚洲综合 | 黄色av电影在线 | 日日干日日干 | 国产一区二区视频在线观看 | 黄色一级片免费播放 | 日穴| 日本亚洲色大成网站www久久 | 欧美男人亚洲天堂 | 亚洲一级成人 | 欧美中文一区 | 手机av中文字幕 | 日本一区精品视频 | 天天插天天 | 黄页网站视频 | 免费三片60分钟 | 中文字幕少妇 | 4388成人网| 伊人97| 欧美一区二区三区啪啪 | 在线观看日本中文字幕 | 国产麻豆精品一区二区 | 91久久婷婷 | 欧美无砖专区免费 | 欧美大黄 | 善良的女朋友在线观看 | 超碰2| 久久久久国产精品视频 | 欧美tv| 国产91在线播放九色 | 狠狠干天天射 | 久久99草| 穿情趣内衣被c到高潮视频 欧美性猛交xxxx黑人猛交 |