GATE Computer Science (CS) 2017 Shift 1 Solved Paper
© examsiri.com
Question : 51 of 65
Marks:
+1,
-0
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) { t |∃u ∈ EMP(tEmpName] = u[EmpName] ∧ ∀ v∈ DEPT(t[DeptId] ≠v[DeptId]))}
(II) {t |∃ u ∈ EMP(t[EmpName] = u[EmpName] ∧ ∃ v ∈ DEPT(t[DeptId] ≠v[DeptId]))}
(III) {t | ∃ u∈ EMP(t[EmpName] = u[EmpName] ∧ ∃ v ∈ DEPT(t[DeptId] = v[DeptId]))}
Which of the above queries are safe?
(I) { t |∃u ∈ EMP(tEmpName] = u[EmpName] ∧ ∀ v∈ DEPT(t[DeptId] ≠v[DeptId]))}
(II) {t |∃ u ∈ EMP(t[EmpName] = u[EmpName] ∧ ∃ v ∈ DEPT(t[DeptId] ≠v[DeptId]))}
(III) {t | ∃ u∈ EMP(t[EmpName] = u[EmpName] ∧ ∃ v ∈ DEPT(t[DeptId] = v[DeptId]))}
Which of the above queries are safe?
Go to Question: