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.
with grading as(
select name,marks,
case when marks%10 !=0 or marks=100 then ceil(marks/10)
else ceil((marks/10)+1)
end as grades
from students)
select case when grades < 8 then null else NAME END as name, Grades , Marks from grading
order by grades desc, name asc,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 →
with grading as( select name,marks, case when marks%10 !=0 or marks=100 then ceil(marks/10) else ceil((marks/10)+1) end as grades from students) select case when grades < 8 then null else NAME END as name, Grades , Marks from grading order by grades desc, name asc,marks asc