[해커랭크] The Report

june·2023년 3월 30일
0

SQL

목록 보기
14/31

The Report

https://www.hackerrank.com/challenges/the-report

SELECT CASE WHEN grade < 8 THEN NULL ELSE name END AS name
     , grade
     , marks
FROM Students s
    INNER JOIN Grades g ON s.marks BETWEEN g.min_mark AND g.max_mark
ORDER BY grade DESC, name, marks

Lesson & Learned

  • 잘못 작성한 쿼리

SELECT CASE WHEN grade < 8 THEN name IS NULL ELSE name END
, grade
, marks
FROM Students s
INNER JOIN Grades g ON s.marks BETWEEN g.min_mark AND g.max_mark
ORDER BY grade DESC

profile
나의 계절은

0개의 댓글