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.
SELECT s.name,g.grade, s.marks
FROM students AS s
INNER JOIN grades AS g
ON s.marks BETWEEN g.min_mark AND g.max_mark
WHERE g.grade >= 8
ORDER BY 2 DESC, 1 ASC;
SELECT replace(s.name,s.name,'NULL'),g.grade, s.marks
FROM students AS s
INNER JOIN grades AS g
ON s.marks BETWEEN g.min_mark AND g.max_mark
WHERE g.grade < 8
ORDER BY 2 DESC, 3 ASC
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 →
SELECT s.name,g.grade, s.marks FROM students AS s INNER JOIN grades AS g ON s.marks BETWEEN g.min_mark AND g.max_mark WHERE g.grade >= 8 ORDER BY 2 DESC, 1 ASC;
SELECT replace(s.name,s.name,'NULL'),g.grade, s.marks FROM students AS s INNER JOIN grades AS g ON s.marks BETWEEN g.min_mark AND g.max_mark WHERE g.grade < 8 ORDER BY 2 DESC, 3 ASC