Question
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:
My Answer
SELECT DISTINCT CITY
FROM STATION
WHERE ID%2 = 0;
Note
EVEN : 짝수
ODD : 홀수
Result
출처 : https://www.hackerrank.com/challenges/weather-observation-station-3/problem
Weather Observation Station 3 | HackerRank
Query a list of unique CITY names with even ID numbers.
www.hackerrank.com
'SQL > HackerRank' 카테고리의 다른 글
[MySQL/HackerRank] Weather Observation Station 5 (0) | 2022.07.31 |
---|---|
[MySQL/HackerRank] Weather Observation Station 4 (0) | 2022.07.30 |
[MySQL/HackerRank] Weather Observation Station 1 (0) | 2022.07.26 |
[MySQL/HackerRank] Japanese Cities' Names (0) | 2022.07.24 |
[MySQL/HackerRank] Japanese Cities' Attributes (0) | 2022.07.24 |