less than 1 minute read

Population Census

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 solution **

SELECT SUM(POPULATION)
FROM CITY
WHERE COUNTRYCODE IN (SELECT CODE
                    FROM COUNTRY
                    WHERE CONTINENT='Asia'
                );

Tags:

Categories:

Updated:

Comments