🤔 문제 분석
1) Query the Name of any student in STUDENTS who scored higher than Marks.
2) Order your output by the last three characters of each name.
3) 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.
💡 풀이
SELECT Name
FROM STUDENTS
WHERE Marks > 75
ORDER BY RIGHT(Name,3), ID
'코딩테스트 > 해커랭크 SQL' 카테고리의 다른 글
[해커랭크/SQL] 20. Employee Salaries (0) | 2023.02.22 |
---|---|
[해커랭크/SQL] 19. Employee Names (0) | 2023.02.22 |
[해커랭크/SQL] 17. Weather Observation Station 12 (REGEXP) (0) | 2023.02.21 |
[해커랭크/SQL] 16. Weather Observation Station 11 (REGEXP) (0) | 2023.02.21 |
[해커랭크/SQL] 15. Weather Observation Station 10 (REGEXP) (0) | 2023.02.21 |
댓글