Asian Population
- URL : https://www.hackerrank.com/challenges/asian-population/problem
- 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.
- MySQL Solution
1
2
3
4
select sum(city.population)
from city
join country on city.countrycode = country.code
where country.continent = 'asia';