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?

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

Use Me  ?

New searches
ADVANCED-DBMS-10CS751-->View question


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



Not the answer you're looking for? Browse other questions from this Question paper or ask your own question.

Join eduladder!