The Report

  • + 0 comments
    SELECT 
        CASE WHEN G.grade >= 8 
            THEN S.name
            ELSE "NULL"
        END,
        G.grade, 
        S.marks 
    FROM STUDENTS as S
    JOIN GRADES as G ON 
        S.marks >= G.min_mark AND 
        S.marks <= G.max_mark
    ORDER BY 
        G.grade DESC, 
        S.name ASC, 
        S.marks;