我有编写SQL查询的作业:
答案 0 :(得分:1)
有几种方法,这种方法适用于第一种情况:
select *
from Country co
where 400 < all (
select ci.Population
from City ci
where ci.CountryID = co.CountryID
)
对于第二种情况:
select *
from Country co
where 0 = (
select COUNT(1)
from City ci
JOIN Building B ON B.CityID = CI.CityID
where ci.CountryID = co.CountryID
)