[SQL] japanese-cities-attributes 문제 풀이 4

한예은·2025년 3월 23일
0

코딩 테스트

목록 보기
14/49
post-thumbnail

후기

내일이 프로젝트 마감이자 발표일이다.
쉬어가는 느낌으로 딱 3문제만 풀겠습니다... ;_;

문제

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:

풀이

SELECT SUM(CITY.POPULATION) 
FROM CITY 
JOIN COUNTRY ON CITY.COUNTRYCODE = COUNTRY.CODE 
WHERE COUNTRY.CONTINENT = 'Asia';
profile
긴 여정의 첫 걸음

0개의 댓글