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/mYCOg/btrpvSR3HjK/bMyhKkNKxD81VK9S7batl0/img.jpg)
![](https://blog.kakaocdn.net/dn/b7QIzs/btrpBDfhQey/rOX0psPVUHk7y5wG2QjRO0/img.jpg)
[My Answer]
SELECT A.NAME
FROM CITY A
INNER JOIN
COUNTRY B
ON A.COUNTRYCODE = B.CODE
WHERE B.CONTINENT = 'Africa'
'Code Problems > SQL_ HackerRank' 카테고리의 다른 글
[Hacker Rank] Placement (0) | 2022.01.24 |
---|---|
[HackerRank] Average Population of Each Continent (0) | 2022.01.04 |
[HackerRank] Population Census (0) | 2021.12.31 |
[HackerRank] Placement (0) | 2021.12.30 |
[HackerRank] Weather Observation Station 20 (0) | 2021.12.28 |