Information about a collection of students is given by the relation . The relation gives which student has enrolled for (or taken) 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?
View worked solution
Answer: B
Let us break down the relational algebra expression step-by-step:
- : This retrieves the set of all female student IDs, say .
- : This retrieves the set of all course IDs, say .
- : This represents the Cartesian product containing all possible pairs of .
- : This yields the pairs of where the female student is not enrolled in that course.
- : Projecting the course IDs from the above difference gives the courses in which at least one female student is not enrolled.
We are given that every course is taken by at least one female student. Therefore, for any course returned by this expression:
- The set of enrolled female students is not empty (at least one female is enrolled).
- The set of enrolled female students is not the entire set (at least one female is not enrolled).
Thus, the enrolled female students for these courses form a non-empty proper subset of all female students. This matches Option B.
Free practice · Your answers on this page are not saved.
