https://www.hackerrank.com/challenges/asian-population/problem?isFullScreen=true
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.
해석:
주어진 CITY와 COUNTRY 테이블에서 COUNTINENT가 Asia인 모든 도시의 총 인구수를 출력하라
SELECT SUM(CITY.POPULATION)
FROM CITY
JOIN COUNTRY ON COUNTRY.Code = CITY.CountryCode
WHERE COUNTRY.CONTINENT = 'Asia'
|
cs |
JOIN과 WHERE을 활용하는 간단한 문제였습니다
'HackerRank' 카테고리의 다른 글
[HackerRank Easy] Weather Observation Station 5[MySQL] (0) | 2022.05.27 |
---|---|
[HackerRank Medium] Symmetric Pairs [MySQL] (0) | 2022.05.26 |
[MySQL] The Report [HackerRank Medium] (0) | 2022.05.26 |
[MySQL] Binary Tree Nodes [HackerRank Medium] (0) | 2022.05.26 |
[MySQL] African Cities[HackerRank Easy] (0) | 2022.05.26 |