We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
Average Population of Each Continent
Average Population of Each Continent
Sort by
recency
|
1777 Discussions
|
Please Login in order to post a comment
SELECT CO.Continent, AVG(CI.Population) FROM CITY CI INNER JOIN COUNTRY CO ON CI.CountryCode = CO.Code GROUP BY CO.Continent;
ms SQL Server
select COUNTRY.Continent, Floor(AVG(CITY.Population)) from city join country on CITY.CountryCode = COUNTRY.Code group by Continent
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;
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