Skip
Arish's avatar

291. Practice - VIEW 3


Exercise: Stats View

Create view with course statistics.

Solution

sql
1CREATE VIEW course_stats AS
2SELECT course,
3  COUNT(*) AS total,
4  AVG(marks) AS average,
5  MAX(marks) AS highest
6FROM students
7GROUP BY course;