Problem
Write the SQL to answer these questions EXACTLY.
/*
SELECT * FROM dbo.tb_HWCourse
SELECT * FROM dbo.tb_HWDepartment
SELECT * FROM dbo.tb_HWEmployee
SELECT * FROM dbo.tb_HWEnrolled
SELECT * FROM dbo.tb_HWStudent
*/
1) List the average age of the students for each course,
2) As well as the number of students enrolled in the course.
3) Be sure to list the CourseCode, the NumStudents, and the AvgAge.
4) If a course has no enrollment, be sure to show zero for both.
5) Order by the average age, oldest of the average first.