> For the complete documentation index, see [llms.txt](https://pavithrasundaram091097s-organiza.gitbook.io/my-space/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://pavithrasundaram091097s-organiza.gitbook.io/my-space/skills/hackerrank/weather-observation-station-7.md).

# Weather Observation Station 7

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

{% embed url="<https://www.hackerrank.com/challenges/weather-observation-station-7/problem?isFullScreen=true>" %}

Sol:

SELECT DISTINCT CITY FROM STATION WHERE CITY REGEXP '\[AEIOU]$';

Explanation:

* REGEXP '\[AEIOU]$': This condition in the WHERE clause checks if the CITY column ends with any of the specified vowels using the regular expression pattern \[AEIOU]$.
  * \[AEIOU] denotes a character class that matches any one character from the specified set of vowels ('A', 'E', 'I', 'O', 'U').
  * $ denotes the end of the string.

So, the query selects cities where the last character of the city name is one of the specified vowels.
