1,125 views
2 votes
2 votes
Is the following query safe?

Consider a database that has the relation schemas EMP(EmpId, EmpName, DeptId), and DEPT(DeptName, DeptId)

1. DEPT_ID in EMP can be null

2.DPET_ID in EMP cannot be null

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

1 Answer

0 votes
0 votes

i think all are safe .

1 and 2 are SQL query and sql is always safe . third one is tuple relational calculas and it is also safe becz there is no negation operation is perfomed.

Related questions

3 votes
3 votes
0 answers
1
Warlock lord asked Jan 19, 2018
1,068 views
Is the query below safe? {t | ∃u ∈ EMP(t[EmpName] = u[EmpName] ∧ ∀v ∈ DEPT(t[DeptId] == v[DeptId]))}Please explain why.
0 votes
0 votes
1 answer
4