SQL & DB/HackerRank SQL Problem

[HackerRank SQL] Weather Observation Station 9, 10(MySQL)

YSY^ 2021. 2. 27. 17:50

www.hackerrank.com/challenges/weather-observation-station-9/problem

 

Weather Observation Station 9 | HackerRank

Query an alphabetically ordered list of CITY names not starting with vowels.

www.hackerrank.com

Answer

select distinct city
from station
where city not regexp '^[aeiou]'

~로 시작하지 않는 것을 나타낼때는 'NOT'를 사용한다.


www.hackerrank.com/challenges/weather-observation-station-10/problem

 

Weather Observation Station 10 | HackerRank

Query a list of CITY names not ending in vowels.

www.hackerrank.com

Answer

select distinct city
from station
where city not regexp '[aeiou]$'

~로 끝나지 않는 거이니 '$'를 사용한다.

728x90
반응형