[Haker Rank] African Cities

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:

[틀린 쿼리]

SELECT * FROM CITY
INNER JOIN COUNTRY ON CITY.COUNTRYCODE=COUNTRY.CODE
WHERE CONTINENT='Africa'코드를 입력하세요

틀린 이유: 테이블이 여러개 있을 때는
어떤 테이블의 칼럼인지 명확하게 해야함

[정답]

SELECT CITY.NAME FROM CITY
INNER JOIN COUNTRY ON CITY.Countrycode=COUNTRY.Code
WHERE CONTINENT='Africa'

좋은 웹페이지 즐겨찾기