Hello coders, today we are going to solve Weather Observation Station 3 HackerRank Solution in SQL.
Problem
Query a list of CITY names from STATION for cities that have an even ID number. Print the results in any order, but exclude duplicates from the answer.
The STATION table is described as follows:
STATION
Field | Type |
ID | NUMBER |
CITY | VARCHAR2(21) |
STATE | VARCHAR2(2) |
LAT_N | NUMBER |
LONG_W | NUMBER |
where LAT_N is the northern latitude and LONG_W is the western longitude.
Solution – Weather Observation Station 3 in SQL
SELECT DISTINCT CITY FROM STATION WHERE MOD(ID, 2) = 0;
Disclaimer: The above Problem (Weather Observation Station 3) is generated by Hacker Rank but the Solution is Provided by CodingBroz. This tutorial is only for Educational and Learning Purpose.