www.hackerrank.com/challenges/weather-observation-station-5/problem
Answer
select city, length(city)
from station
order by length(city), city
limit 1;
select city, length(city)
from station
order by length(city) desc, city
limit 1;
www.hackerrank.com/challenges/weather-observation-station-6/problem
select city
from station
where city regexp '^[aeiou]'
정규표현식을 사용한다.
MySQL에서 정규표현식은 regexp이다.
728x90
반응형
'SQL & DB > HackerRank SQL Problem' 카테고리의 다른 글
[HackerRank SQL] Weather Observation Station 11, 12(MySQL) (0) | 2021.02.27 |
---|---|
[HackerRank SQL] Weather Observation Station 9, 10(MySQL) (0) | 2021.02.27 |
[HackerRank SQL] Weather Observation Station 7, 8(MySQL) (0) | 2021.02.27 |
[HackerRank SQL] Weather Observation Station 3, 4(MySQL) (0) | 2021.02.27 |
[HackerRank SQL] Weather Observation Station 1, 2 (MySQL) (0) | 2021.02.27 |