코딩일기
SQL 코드카타 154 - Revising Aggregations - The Count Function
서재일
2024. 7. 18. 08:23
https://www.hackerrank.com/challenges/japan-population/problem?isFullScreen=true
Japan Population | HackerRank
Query to the sum of the populations of all Japanese cities in CITY.
www.hackerrank.com
Field | Type |
ID | NUMBER |
NAME | VARCHAR2(17) |
COUNTRYCODE | VARCHAR(3) |
DISTRICT | VARCHAR2(20) |
POPULATION | NUMBER |
CITY 테이블:
- ID : 테이블의 고유 키
- NAME : 도시의 이름
- COUNTRYCODE : 국가코드
- DISTRICT : 지역
- POPULATION : 인구
일본 도시의 총 인구를 조회하는 쿼리를 작성하세요. 일본의 CountryCode는 JPN입니다.
select sum(POPULATION )
from CITY
where COUNTRYCODE = 'JPN'