일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | ||||
4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 | 12 | 13 | 14 | 15 | 16 | 17 |
18 | 19 | 20 | 21 | 22 | 23 | 24 |
25 | 26 | 27 | 28 | 29 | 30 | 31 |
Tags
- GROUPBY
- having
- hackerrank
- matplotlib
- 다중 JOIN
- Limit
- 전처리
- MySQL
- 머신러닝
- join
- airflow 설치
- 그로스해킹
- TRUNCATE
- Oracle
- 데이터분석
- SQLite
- 데이터리안 웨비나
- airflow.cfg
- 결측값
- SUM
- 프로그래머스
- seaborn
- PostgreSQL
- 데이터시각화
- solvesql
- 파이썬
- pandas
- not in
- SQL
- Round
Archives
- Today
- Total
Milky's note
[HackerRank](E) African Cities 본문
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:


[답]
- mysql
select city.name from city
join country
on CITY.CountryCode = COUNTRY.Code
where country.CONTINENT = 'Africa'
두 테이블을 join하는 문제이다.
조건 컬럼에서 country 테이블이 사용되고 조회 컬럼에서 city 테이블이 사용되므로 full join을 해준다.
'SQL > SQL 코딩 테스트-HackerRank' 카테고리의 다른 글
[HackerRank](M) The Report (0) | 2022.03.25 |
---|---|
[HackerRank](E) Average Population of Each Continent (0) | 2022.03.25 |
[HackerRank](E) Population Census (0) | 2022.03.25 |
[HackerRank](E) Weather Observation Station 17 (0) | 2022.03.25 |
[HackerRank](E) Weather Observation Station 16 (0) | 2022.03.25 |
Comments