Snoopy [해커랭크/SQL] 18. Higher Than 75 Marks
코딩테스트/해커랭크 SQL

[해커랭크/SQL] 18. Higher Than 75 Marks

Sooyoon Jeong 2023. 2. 22.

 

🤔 문제 분석

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

 

댓글