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
|
1508 Discussions
|
Please Login in order to post a comment
SELECT CN.CONTINENT ,FLOOR(AVG(C.POPULATION)) FROM CITY C INNER JOIN COUNTRY CN ON C.COUNTRYCODE =CN.CODE GROUP BY CN.CONTINENT; this worked instead of round and ceil usage fro round of nearest integer
select C2.continent, round(avg(C1.population)) from city as C1 inner join country as C2 on C1.countrycode = C2.code group by C2.continent
,wrote 'round()' func initially, why is it wrong?
My Initial Code was Select C2.CONTINENT,ROUND(AVG(C1.POPULATION),2) from City C1 Inner Join Country C2 ON C1.CountryCode = C2.Code Group by C2.CONTINENT
with dable1 as ( select countrycode, floor(avg(population)) avpop from city group by countrycode ) select c.continent , floor(avg(d.avpop)) from country c inner join dable1 d on c.code = d.countrycode group by c.continent; Theresult is wrong but does anyone knows why?
Select Country.Continent, FLOOR(AVG(City.Population)) From CITY INNER JOIN COUNTRY ON CITY.CountryCode = COUNTRY.Code GROUP BY COUNTRY.Continent;