SQL ZOO练习——SELECT within SELECT

这篇博客展示了SQL ZOO中的多个练习题,包括筛选人口超过俄罗斯的国家、欧洲国家的人均GDP比较、按洲查找特定国家、找出人口位于加拿大和波兰之间的国家等。通过对各国人口、GDP和面积的数据分析,揭示了如何使用SQL进行复杂的数据查询和比较。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

最近在练习SQL上学习,把结果发上来存个档。

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

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

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

SELECT name FROM world
  WHERE continent = 'Europe' AND
  gdp/population > 
    (SELECT gdp/population FROM world
      WHERE name = 'United Kingdom')

 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
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值