Average Population of Each Continent

  • + 41 comments

    MySQL solution

    From my HackerRank solutions.

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

    Let me know if you have any questions.