Skip to content

Instantly share code, notes, and snippets.

View Justus-coded's full-sized avatar

Justus Ilemobayo Justus-coded

View GitHub Profile
@Justus-coded
Justus-coded / Weather Observation Station 9.sql
Created September 30, 2020 13:37
Hackerrank SQL Challenge
/*
Query the list of CITY names from STATION that do not start with vowels. Your result cannot contain duplicates.
*/
SELECT DISTINCT CITY
FROM STATION
WHERE LEFT(UPPER(CITY), 1) NOT IN ('A', 'E', 'I', 'O', 'U')
@Justus-coded
Justus-coded / Weather Observation Station 8.sql
Created September 29, 2020 18:07
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'))
@Justus-coded
Justus-coded / WOS_7.sql
Created September 29, 2020 17:19
Hackerrank Challenge - Weather Observation Station(WOS)
/*
Query the list of CITY names ending with vowels (a, e, i, o, u) from STATION. Your result cannot contain duplicates.
*/
SELECT DISTINCT CITY
FROM STATION
WHERE RIGHT(UPPER(CITY),1) IN ('A', 'E', 'I', 'O', 'U')