반응형
▶ SQL > Basic Select > Weather Observation Station 8
Problem
Query the list of CITY names from STATION which have vowels (i.e., a, e, i, o, and u) as both their first and last characters. Your result cannot contain duplicates.
The STATION table is described as follows:
My Answer
SELECT DISTINCT CITY
FROM STATION
WHERE CITY REGEXP '^[aeiou]' AND CITY REGEXP '[aeiou]$'
* REGEXP에 대한 내용은 Weather Observation Station 6 포스팅 참고
반응형
'CODING TEST > SQL : HackerRank' 카테고리의 다른 글
[MySQL] Weather Observation Station 12 (0) | 2021.04.07 |
---|---|
[MySQL] Weather Observation Station 11 (0) | 2021.04.07 |
[MySQL] Weather Observation Station 10 (0) | 2021.04.05 |
[MySQL] Weather Observation Station 9 (0) | 2021.04.05 |
[MySQL] Weather Observation Station 7 (0) | 2021.04.02 |
[MySQL] Weather Observation Station 6 (0) | 2021.04.01 |
[MySQL] Weather Observation Station 5 (0) | 2021.03.31 |
[MySQL] Weather Observation Station 4 (0) | 2021.03.31 |
댓글