728x90
반응형
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.
Input Format
The CITY and COUNTRY tables are described as follows:
![](https://blog.kakaocdn.net/dn/caq5vT/btsrCut3Gk7/DT1T4Js9cWHXgEUVWAa6Mk/img.jpg)
![](https://blog.kakaocdn.net/dn/b6KBid/btsrBpUg5uN/v1lTz9POGKy5thcIMnbpm0/img.jpg)
Code
SELECT CITY.NAME
FROM CITY
JOIN COUNTRY ON CITY.COUNTRYCODE = COUNTRY.CODE
WHERE COUNTRY.CONTINENT = 'AFRICA'
728x90
반응형
'SQL > MySQL' 카테고리의 다른 글
[MySQL/HackerRank] Weather Observation Station 2 (0) | 2023.08.25 |
---|---|
[MySQL/HackerRank] Top Earners (0) | 2023.08.25 |
[MySQL/HackerRank] Population Census (0) | 2023.08.21 |
[MySQL/HackerRank] Average Population of Each Continent (0) | 2023.08.21 |
[MySQL/HackerRank] The Blunder (0) | 2023.08.21 |