Recent Posts
Recent Comments
Link
«   2024/12   »
1 2 3 4 5 6 7
8 9 10 11 12 13 14
15 16 17 18 19 20 21
22 23 24 25 26 27 28
29 30 31
Archives
Today
Total
관리 메뉴

Studying data

[HackerRank] Basic Select > Weather Observation Station 6, 7 본문

SQL

[HackerRank] Basic Select > Weather Observation Station 6, 7

halloweenie 2022. 12. 26. 19:58

Weather Observation Station 6

Query the list of CITY names starting with vowels (i.e., a, e, i, o, or u) from STATION. Your result cannot contain duplicates.

Input Format

The STATION table is described as follows:

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

 

[MySQL Solution]

SELECT DISTINCT CITY 
FROM STATION 
WHERE CITY RLIKE '^[aeiouAEIOU]'

 

문제 링크:

https://www.hackerrank.com/challenges/weather-observation-station-6/problem?isFullScreen=true 


Weather Observation Station 7

Query the list of CITY names ending with vowels (a, e, i, o, u) from STATION. Your result cannot contain duplicates.

 

[MySQL Solution]

SELECT DISTINCT CITY 
FROM STATION 
WHERE CITY RLIKE '[aeiouAEIOU]$'

 

문제 링크:

https://www.hackerrank.com/challenges/weather-observation-station-7/problem?isFullScreen=true 

Comments