Consider a database that has the relation schemas EMP(EmpId, EmpName, DeptId),…

PYQ GATE 2017

Consider a database that has the relation schemas EMP(EmpId, EmpName, DeptId), and DEPT(DeptName, DeptId). Note that the DeptId can be permitted to be NULL in the relation EMP. Consider the following queries on the database expressed in tuple relational calculus.

I.    {tt | ∃u ∈ EMP(t[EmpName] = u[EmpName] ∧ ∀v ∈ DEPT(t[DeptId] ≠ v[DeptId]))}

II.    {tt | ∃u ∈ EMP(t[EmpName] = u[EmpName] ∧ ∃v ∈ DEPT(t[DeptId] ≠ v[DeptId]))}

III.    {tt | ∃u ∈ EMP(t[EmpName] = u[EmpName] ∧ ∃v ∈ DEPT(t[DeptId] = v[DeptId]))}

Which of the above queries are safe?

  1. A.

    I and II only

  2. B.

    I and III only

  3. C.

    II and III only

  4. D.

    I, II and III

Attempted by 211 students.

Sign up free to check your answer

Sign up free

Explore the full course: Zero To Hero

Loading lesson…