Exercise: Show Course Max
Show each student with their course's max marks.
Solution
sql
1SELECT name, marks,
2 (SELECT MAX(marks) FROM students
3 WHERE course = s.course) AS course_max
4FROM students s;
Show each student with their course's max marks.
1SELECT name, marks,
2 (SELECT MAX(marks) FROM students
3 WHERE course = s.course) AS course_max
4FROM students s;