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
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