The Report

  • + 0 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;