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.
select Name=
case when grade<8 then null else name end
, Grade, Marks from
students a inner join grades b
on a.marks between b.min_mark and b.max_mark
order by
case when grade>=8 then grade end desc,name asc,
case when grade<=7 then grade end desc,marks 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 →
my solution i hope it pretty easy to understand:
select Name= case when grade<8 then null else name end , Grade, Marks from students a inner join grades b on a.marks between b.min_mark and b.max_mark order by case when grade>=8 then grade end desc,name asc, case when grade<=7 then grade end desc,marks asc