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
- 편향-분산 교환
- window function
- AWS
- 온라인협업
- 선형 모형
- Git
- 코딩공부
- early stopping
- 버전충돌
- hackerrank
- mysql
- elastic net
- 깃헙협업
- 클라우드컴퓨팅
- programmers
- RLIKE
- conflict
- CSS
- full request
- leetcode
- L1정규화
- sql
- branch
- coding
- github
- HTML
- PYTHON
- L2정규화
- merge
- 교차 엔트로피
Archives
- Today
- Total
Im between cherry
Hackerrank | MySQL | Weather Observation Station 11 본문
Weather Observation Station 11
Weather Observation Station 11 | HackerRank
Query a list of CITY names not starting or ending with vowels.
www.hackerrank.com
Query the list of CITY names from STATION that either do not start with vowels or do not end with vowels. Your result cannot contain duplicates.
Solution
SELECT DISTINCT CITY
FROM STATION
WHERE SUBSTR(CITY,1,1) NOT IN ('a','e','i','o','u') or
SUBSTR(CITY,-1,1) NOT IN ('a','e','i','o','u');
SELECT DISTINCT city
FROM station
WHERE city NOT REGEXP '^[aeiou]'
OR city NOT REGEXP '[aeiou]$'
SELECT DISTINCT city
FROM station
WHERE city NOT RLIKE '^[aeiouAEIOU]'
OR city NOT RLIKE '[aeiouAEIOU]$'
SELECT Distinct City
FROM Station
WHERE City NOT rLike '^[aeoui]'
OR City NOT rLike '[aeoiu]$'
SELECT DISTINCT CITY
FROM STATION
WHERE city not rlike "^[aeiouAEIOU].*[aeiou]$"
'데이터분석 > practice_query' 카테고리의 다른 글
Hackerrank | MySQL | Higher Than 75 Marks (0) | 2020.08.28 |
---|---|
Hackerrank | MySQL | Weather Observation Station 12 (0) | 2020.08.28 |
Hackerrank | MySQL | Weather Observation Station 10 (0) | 2020.08.28 |
Hackerrank | MySQL | Weather Observation Station 9 (0) | 2020.08.28 |
Hackerrank | MySQL | Weather Observation Station 8 (0) | 2020.08.27 |
Comments