Created
September 30, 2020 13:45
-
-
Save Justus-coded/99a2a92f29b61dbd6aae365c9da01d7e to your computer and use it in GitHub Desktop.
Hackerrank SQL Challenge
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
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 (RIGHT(UPPER(CITY), 1) NOT IN ('A', 'E', 'I', 'O', 'U')) OR (LEFT(UPPER(CITY), 1) NOT IN ('A', 'E', 'I', 'O', 'U')) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment