We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
I did'nt even sort by marks and got my output accepted. The dataset or the explanation needs to be better to include all cases.
select case when grades.grade <8 then NULL else students.name end,
grades.grade, students.marks
from students
join grades on (students.marks <= grades.max_mark)
and students.marks >= grades.min_mark
order by grades.grade desc, students.name asc;
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
The Report
You are viewing a single comment's thread. Return to all comments →
I did'nt even sort by marks and got my output accepted. The dataset or the explanation needs to be better to include all cases.
select case when grades.grade <8 then NULL else students.name end, grades.grade, students.marks from students join grades on (students.marks <= grades.max_mark) and students.marks >= grades.min_mark order by grades.grade desc, students.name asc;