题目链接:https://sqlzoo.net/wiki/SUM_and_COUNT
![](https://img.haomeiwen.com/i444773/01a89d14293f8631.png)
SELECT SUM(population) FROM world
![](https://img.haomeiwen.com/i444773/4f94436827e562ef.png)
select distinct continent from world;
![](https://img.haomeiwen.com/i444773/cdff625b81c68c42.png)
select sum(gdp) from world
where continent='Africa';
![](https://img.haomeiwen.com/i444773/1294f65d18c7530b.png)
select count(name) from world
where area >= 1000000;
![](https://img.haomeiwen.com/i444773/22e8fe7cfb746f69.png)
select sum(population) from world
where name in ('Estonia', 'Latvia', 'Lithuania')
![](https://img.haomeiwen.com/i444773/f900aa648f7ed7da.png)
select continent ,count(name) from world
group by continent;
![](https://img.haomeiwen.com/i444773/b3318f19be780120.png)
select continent,count(name) from world
where population >= 10000000
group by continent;
![](https://img.haomeiwen.com/i444773/cdee531872514ce0.png)
select continent from world
group by continent
having sum(population) >= 100000000;
网友评论