Please see github.com/anusha-murali for all of my repositories.
Query the list of CITY names from STATION that do not start with vowels. Your result cannot contain duplicates.
The STATION table is described as follows:
where LAT_N
is the northern latitude and LONG_W
is the western longitude.
We can query using REGEXP_LIKE
as follows:
SELECT DISTINCT CITY
FROM STATION
WHERE NOT REGEXP_LIKE(CITY, '^[AEIOU]');
Instead of using NOT
in the WHERE
clause, we can also construct the query as follows:
SELECT DISTINCT CITY
FROM STATION
WHERE REGEXP_LIKE(CITY, '^[^AEIOU]');
Explanation: [^AEIOU]
looks for patterns that do not include the letters ‘A’, ‘E’, ‘I’, ‘O’, ‘U’, and '^[^AEIOU]'
restricts the above exclusion to the first character of the string.