The m
is an alias for the marks
table, and you use that when referencing columns in that table. You are applying it to a column alias:
END m.grade
where it does not belong, so - in that place only - remove the m.
:
select m.marks,
CASE
WHEN m.marks<65 then 'F'
WHEN m.marks>65 then 'P'
END grade
from student s INNER JOIN marks m ON s.id=m.id;
As @Gordon pointed out in a comment, you are checking >65 and <65, so a student with exactly 65 will not get either F or P - the grade for them will be null. You probably want:
WHEN m.marks < 65 then 'F'
WHEN m.marks >= 65 then 'P'
or
WHEN m.marks >= 65 then 'P'
ELSE 'F'
... though if marks
is null the second version will treat that as F too, while the first will still return null.