Average Population of Each Continent

Sort by

recency

|

1810 Discussions

|

  • + 0 comments
     SELECT ctr.continent
    , sum(ct.population) div count(ct.name) as avg_city_population
    from city ct
    join country ctr 
    on ct.countrycode = ctr.code
    GROUP BY ctr.continent;
    
  • + 0 comments

    SELECT COUN.CONTINENT,FLOOR(AVG(CIT.POPULATION)) FROM COUNTRY COUN JOIN CITY CIT ON CIT.COUNTRYCODE = COUN.CODE GROUP BY COUN.CONTINENT; USING ROUND IN PLACE OF FLOOR PRODUCES ERROR I MEAN BOTH DOES THE SAME THING

  • + 0 comments

    SELECT country.continent, floor(avg(city.population)) from country join city on city.countrycode = country.code group by country.continent having avg(city.population) is not null order by avg(city.population);

  • + 0 comments

    SELECT b1.continent, floor(avg(a1.POPULATION)) FROM CITY a1 right JOIN COUNTRY b1 ON a1.COUNTRYCODE = b1.CODE where b1.continent != 'null' and a1.POPULATION != 'null' GROUP BY b1.CONTINENT

    using right join

  • + 0 comments

    SELECT b1.CONTINENT,FLOOR(AVG(a1.POPULATION)) FROM CITY a1 INNER JOIN COUNTRY b1 ON a1.CountryCode = b1.Code GROUP BY b1.CONTINENT