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 | 29 | 30 | 31 |
Tags
- programmers
- 버전충돌
- elastic net
- 편향-분산 교환
- mysql
- 깃헙협업
- leetcode
- 온라인협업
- RLIKE
- coding
- Git
- L1정규화
- github
- early stopping
- L2정규화
- full request
- CSS
- merge
- 코딩공부
- HTML
- hackerrank
- 교차 엔트로피
- conflict
- branch
- 선형 모형
- 클라우드컴퓨팅
- AWS
- window function
- PYTHON
- sql
Archives
- Today
- Total
Im between cherry
Hackerrank | MySQL | Higher Than 75 Marks 본문
Higher Than 75 Marks
Higher Than 75 Marks | HackerRank
Query the names of students scoring higher than 75 Marks. Sort the output by the LAST three characters of each name.
www.hackerrank.com
Query the Name of any student in STUDENTS who scored higher than Marks. Order your output by the last three characters of each name. If two or more students both have names ending in the same last three characters (i.e.: Bobby, Robby, etc.), secondary sort them by ascending ID.
- Solution
SELECT name
FROM students
WHERE marks > 75
ORDER BY RIGHT(name, 3) ASC, id ASC
SELECT name
FROM students
WHERE marks > 75
ORDER BY RIGHT(name, 3), ID ASC
SELECT Name
FROM Students
WHERE Marks > 75
ORDER BY right(Name,3), Id
'데이터분석 > practice_query' 카테고리의 다른 글
Hackerrank | MySQL | Employee Salaries (0) | 2020.08.28 |
---|---|
Hackerrank | MySQL | Employee Names (0) | 2020.08.28 |
Hackerrank | MySQL | Weather Observation Station 12 (0) | 2020.08.28 |
Hackerrank | MySQL | Weather Observation Station 11 (0) | 2020.08.28 |
Hackerrank | MySQL | Weather Observation Station 10 (0) | 2020.08.28 |
Comments