Algorithm/MySQL

[해커랭크(HackerRank)] African Cities (MySQL)

yujin.me 2021. 7. 5. 14:12

문제

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.

코드

SELECT City.name
FROM City 
	INNER JOIN Country ON City.CountryCode = Country.code
WHERE Country.continent = 'Africa'
  1. City 테이블과 Country 테이블에서 Continent가 Africa인 모든 도시의 이름을 출력하라

출처

반응형