728x90
❓ Question
https://www.hackerrank.com/challenges/japan-population
Japan Population | HackerRank
Query to the sum of the populations of all Japanese cities in CITY.
www.hackerrank.com

❗ Answer
SELECT SUM(population)
FROM city
WHERE countrycode = 'JPN';
📌 Discussion
- where 절에서 조건에 맞는 레코드만 추출 후 sum 집계
'SQL 문제풀이' 카테고리의 다른 글
| [해커랭크 SQL] Aggregation - The Blunder (0) | 2023.08.23 |
|---|---|
| [해커랭크 SQL] Aggregation - Population Density Difference (0) | 2023.08.23 |
| [해커랭크 SQL] Aggregation - Average Population (0) | 2023.08.23 |
| [해커랭크 SQL] Aggregation - Revising Aggregations - Averages (0) | 2023.08.23 |
| [해커랭크 SQL] Aggregation - Revising Aggregations - The Sum Function (0) | 2023.08.23 |