Confusion with Tuple Relation Calculus

by lU5er   Last Updated September 18, 2018 09:06 AM

I came upon a question like,

Given the following relational schemas

Student (studId, name, age, sex, deptNo, advisor)

Department (deptId, DName, hod, phoneNo)

Which of the following will be the TRC query to obtain the department names that do not have any girl students?

The correct answer given is

{d.Dname | department(d) ∧ ~ ((∃(s)) student(s) ∧ s.sex = ‘F’ ∧ s.deptNo = d.deptId)}

My interpretation to it is the for every department, the inner logic is trying to find at least one student who is from the same department and is a female. Now if it fails to find one, it return FALSE and the negation will make it TRUE and thus that Dname will be printed. This is perfectly fine.

But if I negate the logic, i.e flow the negate sign then the inner logic becomes,

((∀s ∈ student) s.sex ≠ ‘F’ ∨ s.deptNo ≠ d.deptId). How does this mean the same as above? I cannot imagine it.

Any help is appreciated. Thanks in advance.



Related Questions




Counting in Tuple Relational Calculus

Updated May 02, 2018 10:06 AM


Questions Concerning the Chase Test

Updated July 10, 2018 05:06 AM