Algorithm/MySQL
[해커랭크(HackerRank)] Population Census (MySQL)
yujin.me
2021. 7. 5. 14:19
문제
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.
코드
SELECT SUM(City.population)
FROM City
INNER JOIN Country ON City.CountryCode = Country.Code
WHERE Country.Continent = 'Asia'
- City, Country 테이블에서 모든 도시의 인구의 합계를 구하라
- Continent = 'Asia'
출처
반응형