edited by
20,622 views
97 votes
97 votes

Information about a collection of students is given by the relation $\text{studInfo(}\underline{\text{studId}},\text{ name, sex)}$. The relation $\text{enroll(}{\text{studId}},{\text{ courseId}})$ 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?

$\pi _{courceId}\left(\left(\pi_{\text{studId}}\left(\sigma_{sex=“female"}\left(\text{studInfo}\right)\right) \times \pi_{courseId}\left(\text{enroll}\right)\right) -\text{enroll}\right)$

  1. Courses in which all the female students are enrolled.
  2. Courses in which a proper subset of female students are enrolled.
  3. Courses in which only male students are enrolled.
  4. None of the above
edited by

11 Answers

–2 votes
–2 votes
proper subset means subset not equal to set itself.......so above relational algebra is going to give all courses that "all girls have not taken"
–3 votes
–3 votes

(piesex=female(studid))cross piecourseid(enroll) it gives relation with four attribute(studid,name,sex,enrollid) but it contains only information about female

and if we subtract enroll relTION FROM IT THEN IN SUBSTRACTION ONLY THOSE TUPLES WILL EXTRACTED WHICH ARE NOT IN (ENROLL) but enroll have all because it is original relation so it gives nothing so (d) will be answer 

Answer:

Related questions