Average Population of Each Continent(HackerRank)

yonny·2022년 10월 9일
0
post-custom-banner

Basic Join

문제

https://www.hackerrank.com/challenges/average-population-of-each-continent/forum

Given the CITY and COUNTRY tables, query the names of all the continents (COUNTRY.Continent) and their respective average city populations (CITY.Population) rounded down to the nearest integer.

Note: CITY.CountryCode and COUNTRY.Code are matching key columns.

Input Format:
The CITY and COUNTRY tables are described as follows:

city

country

<내 코드>

SELECT t2.continent, FLOOR(AVG(t1.population))
FROM city t1
    INNER JOIN country t2
    ON t1.CountryCode = t2.Code
group by t2.continent;
post-custom-banner

0개의 댓글