Professional Documents
Culture Documents
20221209テスト模範解答
20221209テスト模範解答
2. select
count(Code)
from
country
;
3. select
Code
, Name
from
country
where
Continent = ‘Asia’
and Population >= 100000000
order by
Population desc
;
4. select
Name
, SurfaceArea
from
country
where
Name like ‘A%’
order by
SurfaceArea asc;
5. select
Continent
, count(Code) as DependCountry
from
country
where
IndepYear is null
group by
Continent
order by
count(Code) desc
;
6. select
Continent
, Region
, sum(Population) as TotalPopulation
, avg(Lifexpectancy) as AvgLifeExpectancy
from
country
group by
Continent
, Region
order by
Continent asc
, Region asc
;
7. update
country
set
IndepYear = 2002
, GNP = 3090.00
where
Code = ‘TMP’
;
8. delete from
country
where
Code = ‘YUG’
;