I am also confused about the invalid "course_id", according to what Kai post earlier, we should consider the function input "course_id" in the "course" table (compare with "
course.id"), and if no student enrols in this course (which suggests that "course_id" will not exist in "course_enrolments" table), we should output the number of all the rooms even with room.capacity is null, but
not raise an exception. If "course_id"
does not match any "course.id" in "course" table, we should raise "INVALID COURSEID".
However, according to your post, it suggests that we should consider the function input "course_id" in the "course_enrolments" table and compare with "course_enrolment.course", if the "course_id" does not match any "course_enrolment.course", we should raise an exception (which means if no student enrol in this course, then we should raise an exception). But according to Kai, we shouldn't raise an exception if "course_id" exist in "course" table event thought it does not exist in "course_enrolments" table.
So when the function input "course_id" exists in "course" table but not in "course_enrolments" table, which one should I follow?

Regards,
Rui
在 2018年5月11日星期五 UTC+10上午9:32:29,Wei Li写道: