Skip
Arish's avatar

222. Practice - Correlated SELECT


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;