Average Population of Each Continent

Sort by

recency

|

1670 Discussions

|

  • + 0 comments

    mysql

    SELECT continent, FLOOR(AVG(city.population)) FROM city
    JOIN country ON city.countrycode = country.code
    GROUP BY continent
    
  • + 1 comment

    Why FLOOR insted of ROUND function? FLOOR(1234.56) will give you 1234.

    ROUND(1234.56, 0) will give you 1235.

  • + 0 comments

    why is my query not working?

    select country.continent , round(avg(city.population),0) from country join city on city.countrycode = country.code group by country.continent;

  • + 1 comment

    SELECT CC.CONTINENT, FLOOR(AVG(C.POPULATION)) FROM CITY C JOIN COUNTRY CC ON CC.CODE = C.COUNTRYCODE GROUP BY CC.CONTINENT

  • + 0 comments
    SELECT co.continent, FLOOR(AVG(ci.population))
    FROM country co
    JOIN city ci ON co.code = ci.countrycode
    GROUP BY co.continent;