Weather Observation Station 9 in SQL | HackerRank Solution

Hello coders, today we are going to solve Weather Observation Station 9 HackerRank Solution in SQL.

Weather Observation Station 9 in SQL

Problem

Query the list of CITY names from STATION that do not start with vowels. Your result cannot contain duplicates.

Input Format

The STATION table is described as follows:

STATION

FieldType
IDNUMBER
CITYVARCHAR2(21)
STATEVARCHAR2(2)
LAT_NNUMBER
LONG_WNUMBER

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

Solution – Weather Observation Station 9 in SQL

MySQL

select distinct city
from station
where not (city like 'A%' or city like 'E%' or city like 'I%' or city like 'O%' or city like 'U%');

Disclaimer: The above Problem (Weather Observation Station 9) is generated by Hacker Rank but the Solution is Provided by CodingBroz. This tutorial is only for Educational and Learning Purpose.

Leave a Comment

Your email address will not be published. Required fields are marked *