Average Population of Each Continent

  • + 0 comments

    For MySQL Platform

    The given answer is wrong. Actually we need to use the ROUND function since it's mentioned to round down to nearest integer. I used FLOOR function just to match the answer

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