https://www.hackerrank.com/challenges/average-population-of-each-continent/problem?isFullScreen=true
Average Population of Each Continent | HackerRank
Query the names of all continents and their respective city populations, rounded down to the nearest integer.
www.hackerrank.com
문제
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:


Code
SELECT COUNTRY.CONTINENT, FLOOR(AVG(CITY.POPULATION))
FROM COUNTRY
JOIN CITY ON COUNTRY.CODE = CITY.COUNTRYCODE
GROUP BY COUNTRY.CONTINENT
'SQL > MySQL' 카테고리의 다른 글
[MySQL/HackerRank] African Cities (0) | 2023.08.21 |
---|---|
[MySQL/HackerRank] Population Census (0) | 2023.08.21 |
[MySQL/HackerRank] The Blunder (0) | 2023.08.21 |
[MySQL/HackerRank] Population Density Difference (0) | 2023.08.21 |
[MySQL/HackerRank] Japan Population (0) | 2023.08.21 |
https://www.hackerrank.com/challenges/average-population-of-each-continent/problem?isFullScreen=true
Average Population of Each Continent | HackerRank
Query the names of all continents and their respective city populations, rounded down to the nearest integer.
www.hackerrank.com
문제
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:


Code
SELECT COUNTRY.CONTINENT, FLOOR(AVG(CITY.POPULATION))
FROM COUNTRY
JOIN CITY ON COUNTRY.CODE = CITY.COUNTRYCODE
GROUP BY COUNTRY.CONTINENT
'SQL > MySQL' 카테고리의 다른 글
[MySQL/HackerRank] African Cities (0) | 2023.08.21 |
---|---|
[MySQL/HackerRank] Population Census (0) | 2023.08.21 |
[MySQL/HackerRank] The Blunder (0) | 2023.08.21 |
[MySQL/HackerRank] Population Density Difference (0) | 2023.08.21 |
[MySQL/HackerRank] Japan Population (0) | 2023.08.21 |