You are viewing a single comment's thread. Return to all comments →
There is no ambiguity
SELECT (CASE WHEN Grades.Grade < 8 THEN 'NULL' ELSE Students.Name END ) , Grades.Grade, Students.Marks FROM Students
LEFT JOIN Grades
on Students.Marks BETWEEN Grades.Min_Mark AND Grades.Max_Mark
ORDER BY Grades.Grade DESC, Students.Name
In question it is mentioned :
If there is more than one student with the same grade (1-7) assigned to them, order those particular students by their "marks" in ascending order.
And you have ordered with name and it is working fine.
This I think is the amiguity in the question
oh yes how could they have accepted it???!!!
I was trying the problem for the last two days because I couldn't get the lower 7 grade thing ordering.
Thanks for the help anyways.