Im between cherry

Hackerrank | MySQL | Weather Observation Station 10 본문

데이터분석/practice_query

Hackerrank | MySQL | Weather Observation Station 10

meal 2020. 8. 28. 09:05

Weather Observation Station 10

Problem

 

Weather Observation Station 10 | HackerRank

Query a list of CITY names not ending in vowels.

www.hackerrank.com

Query the list of CITY names from STATION that do not end with vowels. Your result cannot contain duplicates.

 

 

Solution

SELECT DISTINCT CITY
FROM STATION
WHERE CITY NOT LIKE '%a' AND
CITY NOT LIKE '%e' AND
CITY NOT LIKE '%i' AND
CITY NOT LIKE '%o' AND
CITY NOT LIKE '%u';
SELECT DISTINCT city
FROM station
WHERE city NOT REGEXP '[aeiou]$'
SELECT Distinct City
FROM Station
WHERE City NOT rLike '[aeiou]$'
Comments