We have two tables Students and Grades.
Students contain three columns ID, Name, and Marks.
Grades
Students
I am applying a case when statement to get a max_marks column in the student table as well for that I have written this code but it's not working.
Code:
SELECT
Name,
CASE
WHEN marks < 10 THEN 9
WHEN marks < 20 THEN 19
WHEN marks < 30 THEN 29
WHEN marks < 40 THEN 39
WHEN marks < 50 THEN 49
WHEN marks < 60 THEN 59
WHEN marks < 70 THEN 69
WHEN marks < 80 THEN 79
WHEN marks < 90 THEN 89
ELSE 99
END AS max_mark