1.Total world population

image.png

  1. SELECT SUM(population)
  2. FROM world

2.List of continents

image.png

  1. select distinct continent
  2. from world

3.GDP of Africa

image.png

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

4.Count the big countries

image.png

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

5.Baltic states population

image.png

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

6.Using GROUP BY and HAVING

image.png

  1. select continent,count(name)
  2. from world
  3. group by continent

7.Counting big countries in each continent

image.png

  1. select continent,count(name)
  2. from world
  3. where population >= 10000000
  4. group by continent

8.Counting big continents

image.png

  1. select continent
  2. from world
  3. group by continent
  4. having sum(population) >= 100000000