관리 메뉴

오늘도 배운다

Weather Observation Station 6 / HackerRank, SQL, MySQL 본문

코딩테스트연습(SQL)

Weather Observation Station 6 / HackerRank, SQL, MySQL

LearnerToRunner 2022. 11. 30. 21:54

문제

Query the list of CITY names starting with vowels (i.e., a, e, i, o, or u) from STATION. Your result cannot contain duplicates. Input FormatThe STATION table is described as follows:

 

 

제출답안(MySQL)

SELECT DISTINCT(city) FROM station
WHERE city REGEXP '^a|^e|^i|^o|^u'

 

 

 

풀이(MySQL)

 

개선답안(MySQL)

SELECT DISTINCT(city) FROM station
WHERE city REGEXP '^[aeuio]'

 

 

문제 바로가기(MySQL) 

 

728x90
Comments