Spoiler :
SELECT Subject_Name, SS.Subject_ID, SS.Student_ID, Student_Name, Max(Mark)
FROM Subject AS SU, Student_Subject AS SS, Student AS S
WHERE Mark Is Not Null And SS.Subject_ID=SU.Subject_ID And S.Student_ID=SS.Student_ID
GROUP BY Subject_Name, SS.Subject_ID, SS.Student_ID, Student_Name
ORDER BY SS.Subject_ID;
FROM Subject AS SU, Student_Subject AS SS, Student AS S
WHERE Mark Is Not Null And SS.Subject_ID=SU.Subject_ID And S.Student_ID=SS.Student_ID
GROUP BY Subject_Name, SS.Subject_ID, SS.Student_ID, Student_Name
ORDER BY SS.Subject_ID;
Right now when I run this I get duplicate results for each 'Subject' when what I intend to do is get the top mark of each subject and then the name of the student who achieved it. How would I go about getting it to do that? I feel like I have done something incorrectly with the Table Join in the WHERE clause, but I don't know for sure.