Exercise: Above Course Average
Find students above their course average.
Solution
sql
1SELECT name, course, marks FROM students s
2WHERE marks > (
3 SELECT AVG(marks) FROM students
4 WHERE course = s.course
5);
Find students above their course average.
1SELECT name, course, marks FROM students s
2WHERE marks > (
3 SELECT AVG(marks) FROM students
4 WHERE course = s.course
5);