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 REPORT AS (SELECT
NAME,
(SELECT GRADE FROM GRADES
WHERE MARKS BETWEEN MIN_MARK AND MAX_MARK) AS GRADE,
MARKS
FROM STUDENTS
ORDER BY GRADE DESC, NAME ASC)
SELECT
CASE WHEN GRADE < 8 THEN NULL ELSE NAME END AS NAME,
GRADE,
MARKS
FROM REPORT;
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 REPORT AS (SELECT NAME, (SELECT GRADE FROM GRADES WHERE MARKS BETWEEN MIN_MARK AND MAX_MARK) AS GRADE, MARKS FROM STUDENTS ORDER BY GRADE DESC, NAME ASC)
SELECT CASE WHEN GRADE < 8 THEN NULL ELSE NAME END AS NAME, GRADE, MARKS FROM REPORT;