혜온의 이것저것

[HackerRank] African Cities (MySQL) 본문

Data Analysis/SQL

[HackerRank] African Cities (MySQL)

혜온 :) 2022. 8. 29. 15:15

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: 

풀이
select c1.name
from city c1, country c2
where c1.countrycode = c2.code and c2.continent = 'Africa'
Comments