Information about a collection of students is given by the relation studInfo(studId, name, sex). The relation enroll(studId, courseId) gives which student has enrolled for what course(s). Assume that every course is taken by at least one male and at least one female student. What does the following relational algebra expression represent?
Π_courseId((Π_studId(σ_sex="female"(studInfo)) × Π_courseId(enroll)) − enroll)
- ACourses in which all the female students are enrolled
- Courses in which a proper subset of female students are enrolled
- CCourses in which only male students are enrolled
- DNone of the above
Explanation
The cross product generates every (femaleStudId, courseId) pair. Subtracting the actual enroll relation leaves pairs where a specific female student is NOT enrolled in that course. Projecting courseId gives courses missing at least one female student's enrollment — i.e. courses where the enrolled females are a proper (non-empty, non-full) subset of all female students, since every course is guaranteed to have at least one female enrolled.
Source: GATE CS 2007 (2007)
This question is part of a 15-day revision cycle — sign in and Project Forge will bring it back the day before you'd forget it.