SqlZoo.net习题答案:Using nested SELECT.

习题地址:http://sqlzoo.net/1a.htm

 

表结构:  bbc(name, region, area, population, gdp)

 

 

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

select name 
from bbc 
where population > (select population from bbc where name = 'Russia')

 

1b.List the name and region of countries in the regions containing 'India', 'Iran'.

select name, region 
from bbc 
where region in (select region from bbc where name in ('India', 'Iran')) 

 

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

select name 
from bbc 
where region = 'Europe' 
and GDP/population > (select Gdp/population from bbc where name = 'United Kingdom')

 

1d.Which country has a population that is more than Canada but less than Algeria?

from bbc 
where population < (select population from bbc where name = 'Algeria') 
and population > (select population from bbc where name = 'Canada')

 

2a.Which countries have a GDP greater than any country in Europe? [Give the name only.]

select name
from bbc
where GDP > all (select GDP from bbc where region = 'Europe')

 

3a.Find the largest country in each region, show the region, the name and the population:

select region, name, population
from bbc x
where population >= all (select population from bbc y where x.region = y.region and y.population is not null)

 

3b.Find each country that belongs to a region where all populations are less than 25000000. Show name, region and population.

select name, region, population
from bbc x
where 25000000 > all (select population from bbc y where x.region = y.region)

 

3c.Some countries have populations more than three times that of any of their neighbours (in the same region). Give the countries and regions.

select name, region
from bbc x
where x.population/3 > all (select y.population from bbc y where x.region = y.region and y.name <> x.name)

转载于:https://www.cnblogs.com/Leo-Forest/archive/2012/06/01/2531440.html

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
根据提供的引用内容,错误信息显示是一个由Apache Axis引起的异常,该异常的嵌套异常是java.net.ConnectException,指示连接超时。这通常表示在尝试建立网络连接时,目标主机没有及时响应,或者连接被阻止了。 出现连接超时的原因可能有多种,包括网络问题、服务器问题或者目标主机过载等。在解决此问题之前,我们需要先排除一些可能导致连接超时的常见原因。 首先,确保网络连接正常并且目标主机具备可用性。您可以尝试使用ping命令或者telnet命令来测试与目标主机之间的连接是否正常。如果无法连接到目标主机,您可能需要联系网络管理员或者服务器管理员以解决网络连接问题。 其次,确认目标主机上的服务器是否正在运行并且可以响应请求。您可以尝试通过浏览器或者其他工具访问目标主机上的服务来验证其可用性。如果目标主机服务不可用,您可能需要联系服务器管理员或者开发团队以解决服务问题。 最后,如果网络连接和服务器都正常,但仍然出现连接超时的问题,那可能是目标主机过载导致的。您可以尝试延长连接超时时间或者调整目标主机的负载,以便更好地处理请求。 总结一下,当遇到"Caused by: org.apache.axis.AxisFault: ; nested exception is: java.net.ConnectException: Connection timed out (Connection timed out)"的错误信息时,我们需要先排除网络连接问题、目标主机服务是否可用以及目标主机过载等可能导致连接超时的原因。根据具体情况进行逐个排查并解决问题。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值