The Report

  • + 2 comments

    I tried the following query:

    select case when g.grade>7 then s.name else NULL end,g.grade,s.marks from students s inner join grades g on s.marks between g.min_mark and g.max_mark order by case when g.grade<8 then s.marks end, case when g.grade>7 then g.grade end desc, s.name;

    I am getting the below result which appears to be correct when compared with the input table. But it says that the output is wrong. Please let me know where I have made a mistake.

    Britney 10 95 Heraldo 10 94 Julia 10 96 Kristeen 10 100 Stuart 10 99 Amina 9 89 Christene 9 88 Salma 9 81 Samantha 9 87 Scarlet 9 80 Vivek 9 84 Aamina 8 77 Belvet 8 78 Paige 8 74 Priya 8 76 Priyanka 8 77 NULL 3 24 NULL 4 34 NULL 6 55 NULL 7 64 NULL 7 66