See Our team

Wondering how we keep quality?

Got unsolved questions?

Ask Questions

Engineering
GATE
CBSE
NCERT
Psychology
English
Computer
Constitution
Astrology
Yoga
Economics
Physics
Biology
Electronics
Microprocessor
Career
Interview
Anatomy
Botany

## 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:

|debikadebnath|Aparna-Dasgupta|sukhil-vadakkan|satyashiromani|msumesh|prabhat2346|nidhi-gupta|Amogh|prajwalamv|mmodi1995|winmyintthein|Akhil-Raj|Msshikhil|harshshah822|Shivaratnakumar-Patil|244|fmtatenda|vaishnavi-Deshpande|milanyoyoyogmailcom|bekezela17|Umang|Ssewanyana-Herbert-|ThreeRed|bino|PerumalS|Anagha|deepuckraj|Manisha12|milan-ransingh|pankaj

Likes:

Be first to like this question

Dislikes:

Be first to dislike this question

Talk about thisDelete|Like|Dislike|

## Answers

**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

Talk about this|Once you have earned teacher badge you can edit this questionDelete|Like|Dislike|

------------------------------------

#### Can you help us to add better answer here? Please see this

Loading...

## Use Me ?