Weather Observation Station 7
Problem
Query the list of CITY names ending with vowels (a, e, i, o, u) from STATION. Your result cannot contain duplicates.
(STATION에서 모음(a, e, i, o, u)으로 끝나는 도시(CITY) 이름의 목록을 조회하라. 결과에는 중복이 포함되어서는 안 됨.)
Input Format
The STATION table is described as follows:
Solution(Oracle)
SELECT DISTINCT CITY
FROM STATION
WHERE CITY LIKE '%a'
OR CITY LIKE '%e'
OR CITY LIKE '%i'
OR CITY LIKE '%o'
OR CITY LIKE '%u';
-- 대소문자 구분없이 사용하고 싶을때
SELECT DISTINCT CITY
FROM STATION
WHERE UPPER(CITY) LIKE '%A'
OR UPPER(CITY) LIKE '%E'
OR UPPER(CITY) LIKE '%I'
OR UPPER(CITY) LIKE '%O'
OR UPPER(CITY) LIKE '%U';
https://www.hackerrank.com/challenges/weather-observation-station-7/problem
Weather Observation Station 7 | HackerRank
Query the list of CITY names ending with vowels (a, e, i, o, u) from STATION.
www.hackerrank.com
'SQL' 카테고리의 다른 글
[HackerRank SQL] Weather Observation Station 6 (Oracle) (0) | 2024.03.30 |
---|---|
[HackerRank SQL] Weather Observation Station 5 (Oracle) (0) | 2024.03.29 |
[HackerRank SQL] Weather Observation Station 4 (Oracle) (0) | 2024.03.28 |
[HackerRank SQL] Weather Observation Station 3 (Oracle) (0) | 2024.03.27 |
[HackerRank SQL] Weather Observation Station 1 (Oracle) (0) | 2024.03.26 |