Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
Tags
- SQL 날짜 데이터
- 설명의무
- 자연어처리
- 카이제곱분포
- HackerRank
- nlp논문
- 서브쿼리
- 논문리뷰
- GRU
- inner join
- 자연어 논문 리뷰
- Statistics
- LSTM
- update
- torch
- leetcode
- MySQL
- 그룹바이
- 자연어 논문
- SQL코테
- 표준편차
- t분포
- 코딩테스트
- CASE
- NLP
- airflow
- sql
- sigmoid
- 짝수
- Window Function
Archives
- Today
- Total
HAZEL
[SQL : 정규표현식 ] HackerRank : Weather Observation Station 7 / 8 본문
DATA ANALYSIS/SQL
[SQL : 정규표현식 ] HackerRank : Weather Observation Station 7 / 8
Rmsid01 2021. 5. 16. 18:08Weather Observation Station 7
>> 문제
Query the list of CITY names ending with vowels (a, e, i, o, 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.
>> 기본적으로 푸는 방법
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 city REGEXP '.*[aeiou]$'
' $ ' : 마지막 글자일 때, 매치한다는 의미이다.
' * ' : 여러 문자를 가짐을 의미한다.
https://www.hackerrank.com/challenges/weather-observation-station-7/problem
Weather Observation Station 8
>> 문제
Query the list of CITY names from STATION which have vowels (i.e., a, e, i, o, and u) as both their first and last characters. 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.
>> 문제 풀이
SELECT DISTINCT city
FROM station
WHERE city REGEXP '^[aeiou].*[aeiou]$'