문제
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'
출처
반응형
'Algorithm > MySQL' 카테고리의 다른 글
[LeetCode] 183. Customers Who Never Order (MySQL) (0) | 2021.07.05 |
---|---|
[해커랭크(HackerRank)] Average Population of Each Continent (MySQL) (0) | 2021.07.05 |
[해커랭크(HackerRank)] African Cities (MySQL) (0) | 2021.07.05 |
[LeetCode] Duplicate Emails (MySQL) (0) | 2021.07.05 |
[LeetCode] 620. Not Boring Movies (MySQL) (0) | 2021.07.05 |