SQL/MySQL

[MySQL/HackerRank] Population Census

NLP Developer 2023. 8. 21. 01:40
728x90
반응형

https://www.hackerrank.com/challenges/asian-population/problem?isFullScreen=true 

 

Population Census | HackerRank

Query the sum of the populations of all cities on the continent 'Asia'.

www.hackerrank.com

문제

Given the CITY and COUNTRY tables, query the sum of the populations of all cities where the CONTINENT is 'Asia'.

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

Input Format

The CITY and COUNTRY tables are described as follows: 

Code

SELECT SUM(CITY.POPULATION)
FROM CITY
JOIN COUNTRY ON CITY.COUNTRYCODE = COUNTRY.CODE
WHERE COUNTRY.CONTINENT = 'ASIA'
728x90
반응형