Weather Observation Station 3

HackerRank SQL Problem:

Query a list of CITY names from STATION with even ID numbers only. You may print the results in any order, but must exclude duplicates from your answer.

Logic:

This is the “Easy” level. And we only have to be careful to use modulus for finding even numbers, and use “distinct” function.

Solution:

select distinct city from station where (id % 2) = 0;

Link

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Isabelle

Isabelle

In love with telling stories with data