Skip to content

Instantly share code, notes, and snippets.

@Justus-coded
Created September 29, 2020 18:07
Show Gist options
  • Save Justus-coded/4e152b6b19b097a41f411a9347d5cf6d to your computer and use it in GitHub Desktop.
Save Justus-coded/4e152b6b19b097a41f411a9347d5cf6d to your computer and use it in GitHub Desktop.
Hackerrank SQL Challenge
/*
Query the list of CITY names from STATION which have vowels (i.e., a, e, i, o, and u) as both their first and last characters. Your result cannot contain duplicates.
*/
SELECT DISTINCT CITY
FROM STATION
WHERE (LEFT(UPPER(CITY),1) IN ('A','E','I','O','U')) AND (RIGHT(UPPER(CITY),1) IN ('A','E','I','O','U'))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment