We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
MY SQL
SELECT
5
CASE
6
WHEN g.grade < 8 THEN 'NULL'
7
ELSE s.name
8
END AS name,
9
g.grade,
10
s.marks
11
FROM students s
12
INNER JOIN grades g
13
ON s.marks BETWEEN g.min_mark AND g.max_mark
14
ORDER BY g.grade DESC, s.name;
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
The Report
You are viewing a single comment's thread. Return to all comments →
MY SQL SELECT 5 CASE 6 WHEN g.grade < 8 THEN 'NULL' 7 ELSE s.name 8 END AS name, 9 g.grade, 10 s.marks 11 FROM students s 12 INNER JOIN grades g 13 ON s.marks BETWEEN g.min_mark AND g.max_mark 14 ORDER BY g.grade DESC, s.name;