Relation Schema :
- Employee (Name, Ssn, Bdate, Address, Dept_number)
- Project (Pname, Pno, Dept_number)
- WorksOn (Essn, Pno, Hours)
List the names of employees who work on all the projects controlled by department number 10.
My Answer :
$\left \{ e.Name | Employee(e) \land \exists\ p(Project(p) \land p.Dept\_number = 10) \land (\forall p ( \exists w ( worksOn(w) \land w.Pno = p.pno \land w.Essn = e.ssn))) \right \}$
Please confirm if it is correct or not.
The solution provided was :
$\left \{ e.Name | Employee(e) \land (\forall x (Project (x) \land x.Dept\_number = 10 )) \to (\exists w)(WorksOn(w) \land w.Essn = e.ssn \land x.Pno = w.Pno) \right \}$
However, I think that it will also print unnecessary values of employee name because for the "implies" part, if the LHS becomes false (may be because x.Dept_number = 5 ), then all of the "implies" part will be evaluated to True and thus those employees name will be printed who work for some project at department no. 5 and not for the department no. 10 ?