Prepare > SQL > Aggregation > Japan Population

2023. 5. 16. 20:34HackerRank-My SQL

 

Japan Population | HackerRank

Query to the sum of the populations of all Japanese cities in CITY.

www.hackerrank.com

 

문제


Query the sum of the populations for all Japanese cities in CITY. The COUNTRYCODE for Japan is JP.

 

 

 

 

코드


SELECT SUM(POPULATION) FROM CITY
WHERE COUNTRYCODE= 'JPN';

 

 

두 번째 시도

SELECT SUM(POPULATION) FROM CITY
WHERE COUNTRYCODE = 'JPN';