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:


[My Answer]
SELECT SUM(A.POPULATION)
FROM CITY A
inner join
COUNTRY B
ON A.COUNTRYCODE = B.CODE
AND B.CONTINENT = 'Asia';
이전 포스트가 weather 문제 다음 문제가 아니였나보다... 그치 갑자기 조인 세개 거는게 이상하긴 했다.. 순서 실수..
'Code Problems > SQL_ HackerRank' 카테고리의 다른 글
[HackerRank] Average Population of Each Continent (0) | 2022.01.04 |
---|---|
[HackerRank] African Cities (0) | 2022.01.03 |
[HackerRank] Placement (0) | 2021.12.30 |
[HackerRank] Weather Observation Station 20 (0) | 2021.12.28 |
[HackerRank] Weather Observation Station 19 (0) | 2021.11.26 |