日韩性视频-久久久蜜桃-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的全部內容,希望文章能夠幫你解決所遇到的問題。

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

主站蜘蛛池模板: 国产91免费在线观看 | 婷婷伊人久久 | 中文字幕在线免费视频 | 中字av在线 | 亚洲精品男女 | 看全黄大色黄大片美女人 | 久草免费在线观看视频 | 亚洲精品一线二线三线 | 深夜福利91| 欧美国产日本 | 日日燥夜夜燥 | 国产精品三级电影 | 骑骑上司妻电影 | 色婷婷中文| 国产精品天天av精麻传媒 | 91av国产在线 | 人人舔 | 国产综合内射日韩久 | 男裸体无遮挡网站 | 99日韩| 91精品91久久久中77777 | 韩国午夜av | 亚洲色精品三区二区一区 | 欧美国产视频一区 | 国产精品久久久影院 | 亚洲蜜臀av一区二区三区 | 国产免费午夜 | 国内成人综合 | 国产精品网站在线 | 久久艹综合 | 日韩和一区二区 | 91麻豆一区二区三区 | 午夜黄色小视频 | 91精品国产综合久久久蜜臀粉嫩 | 色香天天 | 欧美三级日本三级 | 欧美亚洲高清 | 日本一道本在线 | 男女福利视频 | 中文在线国产 | 女人脱裤子让男人捅 | 在线观看一区二区三区四区 | 亚洲女人天堂成人av在线 | www国产 | 国产精品午夜在线观看 | 美妇湿透娇羞紧窄迎合 | 国产淫视| 黄瓜视频色版 | 欧美三日本三级少妇三级99观看视频 | 成人午夜视频免费看 | 91 在线视频 | 老司机午夜影院 | 欧美黑人一级爽快片淫片高清 | 激情视频91| 亚洲永久免费视频 | 亚欧美在线 | 国产网站在线 | 国产超碰人人爽人人做人人爱 | 国产拍拍拍 | 亚洲一区二区动漫 | 爱情岛亚洲论坛入口福利 | 欧美一区二区三区激情啪啪 | 国产极品一区二区 | 夜夜嗨一区二区三区 | 91黄免费 | 日日骚一区 | 亚洲精品一区二区三区在线观看 | 成年人免费看黄色 | a级无遮挡超级高清-在线观看 | 免费毛片一级 | 一区二区三区www污污污网站 | 国产网红主播精品av | 亚洲一区精品视频 | 亚洲av成人无码一区二区三区在线观看 | 日本成人不卡 | 亚洲专区在线 | 国产精品一区二区av白丝下载 | 最新国产一区 | 中文字幕中文字幕 | 极品毛片 | 成年人免费视频观看 | 亚洲视频在线一区二区 | 天天摸天天操天天爽 | 日韩久久久久久 | 亚洲第一二区 | 亚洲另类网站 | 天天艹日日艹 | 亚洲av色香蕉一区二区三区 | 亚洲乱乱| 日韩亚洲欧美综合 | 四色在线 | 先锋影音av在线资源 | 免费视频毛片 | 爱情岛论坛成人av | 中文精品一区二区三区 | 91日韩视频 | 欧美一区二区三区免费观看 | 国产香蕉一区 | 免费av电影网站 |