Average Population of Each Continent

Sort by

recency

|

1777 Discussions

|

  • + 0 comments

    SELECT CO.Continent, AVG(CI.Population) FROM CITY CI INNER JOIN COUNTRY CO ON CI.CountryCode = CO.Code GROUP BY CO.Continent;

  • + 0 comments

    ms SQL Server

    SELECT
        COUNTRY.CONTINENT,
        ROUND(AVG(CITY.POPULATION), 0)
    FROM CITY
    JOIN COUNTRY
        ON CITY.CountryCode = COUNTRY.Code
    GROUP BY COUNTRY.CONTINENT;
    
  • + 0 comments

    select COUNTRY.Continent, Floor(AVG(CITY.Population)) from city join country on CITY.CountryCode = COUNTRY.Code group by Continent

  • + 0 comments

    This one is easier:

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

  • + 0 comments

    select COUNTRY.Continent, FLOOR(avg(CITY.Population)) from CITY INNER JOIN COUNTRY ON CITY.CountryCode = COUNTRY.Code GROUP BY COUNTRY.Continent ORDER BY COUNTRY.Continent