Skip
Arish's avatar

192. Practice - JOIN GROUP 2


Exercise: Average by Course

Find average marks per course.

Solution

sql
1SELECT c.course_name, AVG(s.marks) AS avg_marks
2FROM students s
3JOIN courses c ON s.course_id = c.id
4GROUP BY c.course_name;