코딩테스트연습(SQL)

Weather Observation Station 7 / HackerRank, SQL, MySQL

LearnerToRunner 2022. 11. 30. 22:00

문제

Query the list of CITY names ending with vowels (a, e, i, o, 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$'

 

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

 

 

풀이(MySQL)

 

개선답안(MySQL)

SELECT DISTINCT(city) FROM station
WHERE city REGEXP '[aeiou]$'

 

 

문제 바로가기(MySQL) 

 

728x90