Consider a database that has the relation schemas EMP EmpId EmpName DepId and DEPTDeptName DeptId Note that the DepId can be permitted to be NULL in the relation EMP Consider the following queries on the database expressed in tuple relational calculus gate computer science 2017
The Eduladder is a community of students, teachers, and programmers just interested to make you pass any exams. So we solve previous year question papers for you.
See Our team
Wondering how we keep quality?
Got unsolved questions?

Hey! Want to work with us? Our youtube channel See our Jd Want to apply? Do it today

New searches

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

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

A) I and II only
B) I and III only
C) II and III only
D) I, II, and III

By:satyashiromani

Taged users:

Likes:
Be first to like this question

Dislikes:
Be first to dislike this question

D) I, II, and III

Explanation:
A SAFE EXPRESSION is one that is guaranteed to yield a finite number of tuples as its results. Otherwise, it is called UNSAFE Given, DepId can be permitted to be NULL

I. {t | ∃ u ∈ EMP (t[EMPName] = u[EmpName] ∧ ∀ v ∈ DEPT (t[DeptId] ≠ DeptId]))} : Gives empnames who donot belong to any department
II. {t | ∃ u ∈ EMP (t[EMPName] = u[EmpName] ∧ ∃ v ∈ DEPT (t[DeptId] ≠ DeptId]))} : Gives empnames who donot belong to some department
III. {t | ∃ u ∈ EMP (t[EMPName] = u[EmpName] ∧ ∃ v ∈ DEPT (t[DeptId] = DeptId]))}: Gives empnames who donot belong to same department
All of these queries are giving some results which are finite and thus all are safe expressions.
Therefore, option D is correct.

This explanation is contributed by Deepak Raj.

deepuckraj

Likes:
Be first to like this answer

Dislikes:
Be first to dislike this answer