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.
WITH Full_Table AS(
SELECT s.name AS name,g.grade AS grade,s.marks AS marks
FROM Students s
INNER JOIN
Grades g
ON
s.marks BETWEEN g.Min_Mark AND g.Max_Mark
)
SELECT (CASE WHEN grade>=8 THEN name ELSE null END),
grade,
marks
FROM Full_Table
ORDER BY grade DESC, 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 →
WITH Full_Table AS( SELECT s.name AS name,g.grade AS grade,s.marks AS marks FROM Students s INNER JOIN Grades g ON s.marks BETWEEN g.Min_Mark AND g.Max_Mark )
SELECT (CASE WHEN grade>=8 THEN name ELSE null END), grade, marks FROM Full_Table ORDER BY grade DESC, name;