Query the list of CITY names ending with vowels (a, e, i, o, u) from STATION. Your result cannot contain duplicates. code example

Example 1: query string starts with vowels

select city from station where city REGEXP "^[aeiou].*";

Example 2: Query the list of CITY names from STATION that either do not start with vowels or do not end with vowels. Your result cannot contain duplicates.

SELECT DISTINCT CITY FROM STATION WHERE LOWER(SUBSTR(CITY,1,1)) NOT IN ('a','e','i','o','u') AND LOWER(SUBSTR(CITY,LENGTH(CITY),1)) NOT IN ('a','e','i','o','u');

Tags:

Sql Example