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.
Input Format
The STATION table is described as follows:
where LAT_N is the northern latitude and LONG_W is the western longitude.
[My Answer]
1
2
3
4
|
SELECT DISTINCT city
FROM station
WHERE city REGEXP "^[aeiou].*[aeiou]$";
|
cs |
I had trouble understanding REGEXP, but after visit this blog, I got it right away...
Thanks alot.
'Code Problems > SQL_ HackerRank' 카테고리의 다른 글
[HackerRank] Weather Observation Station 10 (0) | 2021.07.01 |
---|---|
[HackerRank] Weather Observation Station 9 (0) | 2021.05.01 |
[HackerRank] Weather Observation Station 7 (0) | 2021.04.18 |
[HackerRank] Weather Observation Station 6 (0) | 2021.04.17 |
[Hacker Rank] Weather Observation Station 5 (0) | 2021.04.17 |