[문제]
CITY 및 COUNTRY 테이블 이 주어지면 CONTINENT 가 'Africa' 인 모든 도시의 이름을 쿼리하십시오 .참고: CITY.CountryCode 및 COUNTRY.Code 는 일치하는 키 열입니다.

[풀이]
select city.name
from city
join country
on city.countrycode = country.code
where continent = 'africa';
- join (연결할 테이블) on (연결할 같은 조건의 컬럼)
- 두 개의 테이블을 연결하여 continent가 africa인 city의 이름을 출력.
'DB > SQL' 카테고리의 다른 글
| [HackerRank : SQL - oracle] Top Earners (0) | 2022.11.20 |
|---|---|
| [HackerRank : SQL - oracle] Population Density Difference (0) | 2022.11.20 |
| [HackerRank : SQL - oracle] Japan Population (0) | 2022.11.20 |
| [HackerRank : SQL - oracle] Average Population (0) | 2022.11.20 |
| [HackerRank : SQL - oracle] Revising Aggregations - Averages (0) | 2022.11.20 |