Anusha Murali

Logo

Please see github.com/anusha-murali for all of my repositories.

View GitHub Profile

21. Weather Observation Station 6: Solution


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

The STATION table is described as follows:

16

where LAT_N is the northern latitude and LONG_W is the western longitude.

solution_image5

SELECT DISTINCT CITY
FROM STATION
WHERE SUBSTR(CITY, 1, 1) IN ('A', 'E', 'I', 'O', 'U');

We could also use Oracle’s REGEXP_LIKE() function as follows:

SELECT DISTINCT CITY
FROM STATION
WHERE REGEXP_LIKE (CITY, '^[AEIOU]');

Back to problems


anusha-murali.github.io