当前位置:   article > 正文

SQLZOO_5 SUM and COUNT_show the total population of the world. world(name

show the total population of the world. world(name, continent, area, populat

1.Show the total population of the world.
world(name, continent, area, population, gdp)

SELECT SUM(population)
FROM world
  • 1
  • 2

2.List all the continents - just once each.

select distinct continent from world
  • 1

3.Give the total GDP of Africa

select sum(gdp) from world
where continent='Africa'
  • 1
  • 2

4.How many countries have an area of at least 1000000

select count(name) from world
where area>=1000000
  • 1
  • 2

5.What is the total population of (‘Estonia’, ‘Latvia’, ‘Lithuania’)

select sum(population) from world
where name in('Estonia','Latvia','Lithuania')
  • 1
  • 2

6.For each continent show the continent and number of countries.

select continent,count(name) from world
group by contine
  • 1
声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/秋刀鱼在做梦/article/detail/954193
推荐阅读
相关标签
  

闽ICP备14008679号