1
$\begingroup$

I was reading Tuple Relational Calculus from a textbook. I came across this query:

For every project located in 'Stafford', list the project number, the controlling department number, and the department manager's last name, birth date and address.

The solution query is:

{p.Pnumber,p.Dnum,m.Lname,m.Bdate,m.Address | 
    PROJECT(p)}  AND
    EMPLOYEE(m)  AND
    p.Plocation = 'Stafford' AND
    ((∃d)(DEPARTMENT(d) AND
          p.Dnum = d.Dnumber AND
          d.Mgr_ssn = m.Ssn
         )
    )
}

I dont understand what difference existential quantifier will make if I can write the same query as follows without existential quantifier (and of course if it produces same result and hence correct, which also I dont know):

{p.Pnumber,p.Dnum,m.Lname,m.Bdate,m.Address | 
    PROJECT(p)}  AND
    EMPLOYEE(m)  AND
    DEPARTMENT(d) 
    p.Plocation = 'Stafford' AND
    p.Dnum = d.Dnumber AND
    d.Mgr_ssn = m.Ssn    
}

Is it like: the solution query provided uses existential quantifier just because we dont actually project DEPARTMENT relation's attributes in the final output?

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.