0

I have a schema that looks like this: Student (sid, name, age, department) Course(cid, name) Enrollment(sid, cid, term, grade)

Using relational calculus, find the names of the students who took all courses. What I have now looks like this:

{t | ∃ s ∈ Student (t.name = s.name ^ ∃ e ∈ Enrollment(s.sid = e.sid ^ ∀ c ∈ C (c.cid = e.cid))) }

Can someone tell me if this is right or not.

philipxy
  • 14,867
  • 6
  • 39
  • 83
user4348719
  • 351
  • 1
  • 2
  • 13

1 Answers1

0

Your query isn't correct or well formed. Logical conjunction doesn't range over quantifiers (i.e. you can't write ^ ∀) and even if it did, your expression would try to find all course ids in a single enrollment of a single student.

The correct answer could be stated in English: find all students where there doesn't exist a course for which the student doesn't have an enrollment.

reaanb
  • 9,806
  • 2
  • 23
  • 37
  • "you can't write ^ ∀" There's no syntax problem evident, the syntax seems to have `wff ^ wff` a wff & `∀ tuple ∈ base (wff)` a wff. – philipxy Feb 24 '22 at 02:04