일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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
- SQLite
- SQL
- TRUNCATE
- seaborn
- 프로그래머스
- pandas
- solvesql
- 파이썬
- SUM
- Oracle
- 다중 JOIN
- 데이터리안 웨비나
- 머신러닝
- Round
- GROUPBY
- not in
- join
- airflow 설치
- 결측값
- having
- airflow.cfg
- PostgreSQL
- Limit
- hackerrank
- MySQL
- 그로스해킹
- 데이터시각화
- matplotlib
- 전처리
- 데이터분석
Archives
- Today
- Total
Milky's note
[HackerRank](E) Weather Observation Station 7 본문
https://www.hackerrank.com/challenges/weather-observation-station-7/problem?isFullScreen=true
[문제]
Query the list of CITY names ending with vowels (a, e, i, o, u) from STATION. Your result cannot contain duplicates.
Input Format
The STATION table is described as follows:
where LAT_N is the northern latitude and LONG_W is the western longitude.
[답]
- mysql
select distinct(city) from station
where right(city,1) in ('a','e','i','o','u');
select distinct(city) from station
where city like '%a'
or city like '%e'
or city like '%i'
or city like '%o'
or city like '%u';
앞의 6번문제와 반대로 a, e, i, o, u로 끝나는 도시 이름을 찾는 것 이므로
left를 맨 끝 글자인 right 1로 변경하여 조회한다.
'SQL > SQL 코딩 테스트-HackerRank' 카테고리의 다른 글
[HackerRank](E) Weather Observation Station 9 (0) | 2022.03.16 |
---|---|
[HackerRank](E) Weather Observation Station 8 (0) | 2022.03.16 |
[HackerRank](E) Weather Observation Station 6 (0) | 2022.03.16 |
[HackerRank](E) Weather Observation Station 5 (0) | 2022.03.16 |
[HackerRank](E) Weather Observation Station 4 (0) | 2022.03.16 |
Comments