내용>
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.
즉, COUNTRY.CONTINENT = 'Africa' 인 CITY.NAME 을 조회해라.
CITY.CountryCode and COUNTRY.Code 는 매칭된다.
조인 기초문제라서 금방 풀 수 있었다.
뜬끔, TMI이지만 방금 코드블럭 기능을 찾았다..
훨씬 보기가 좋다.^___^
SELECT B.NAME
FROM COUNTRY A
INNER JOIN CITY B ON A.Code = B.CountryCode
WHERE A.CONTINENT = 'Africa'
끝.
'개인공부 > SQL' 카테고리의 다른 글
[SQL]리트코드 181. Employees Earning More Than Their Managers 문제 풀이 (0) | 2023.04.22 |
---|---|
[SQL]리트코드 183. Customers Who Never Order 문제 풀이 (0) | 2023.04.22 |
[SQL]해커랭크 Population Census 문제 풀이 (0) | 2023.04.22 |
[SQL]해커랭크 Average Population of Each Continent 문제 풀이 (0) | 2023.04.22 |
[SQL]자주쓰는 SQL 정리 (1) | 2023.04.19 |