HackerRank

[MySQL] African Cities[HackerRank Easy]

치킨먹고싶어요 2022. 5. 26. 11:33

https://www.hackerrank.com/challenges/african-cities/problem?isFullScreen=true 

 

African Cities | HackerRank

Query the names of all cities on the continent 'Africa'.

www.hackerrank.com

 

Given the CITY and COUNTRY tables, query the names of all cities where the CONTINENT is 'Africa'.

Note: CITY.CountryCode and COUNTRY.Code are matching key columns.

 

 

해석:

주어진 CITY와 COUNTRY 테이블에서 COUNTINENT가 Africa인 모든 도시의 이름을 출력하라

SELECT CITY.NAME
FROM CITY
JOIN COUNTRY ON COUNTRY.Code = CITY.CountryCode
WHERE COUNTRY.CONTINENT = 'Africa'
cs

 

JOIN과 WHERE을 활용하는 간단한 문제였습니다