일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
- sql
- MySQL
- leetcode
- airflow
- Statistics
- 코딩테스트
- 서브쿼리
- 표준편차
- GRU
- LSTM
- torch
- 자연어처리
- 논문리뷰
- 설명의무
- update
- 짝수
- Window Function
- 카이제곱분포
- HackerRank
- 그룹바이
- t분포
- sigmoid
- 자연어 논문 리뷰
- SQL코테
- 자연어 논문
- nlp논문
- SQL 날짜 데이터
- CASE
- NLP
- inner join
- Today
- Total
HAZEL
[SQL : 정규표현식 ] HackerRank : Weather Observation Station 7 / 8 본문
[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 7 | HackerRank
Query the list of CITY names ending with vowels (a, e, i, o, u) from STATION.
www.hackerrank.com
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]$'
Weather Observation Station 8 | HackerRank
Query CITY names that start AND end with vowels.
www.hackerrank.com