Use app×
Join Bloom Tuition
One on One Online Tuition
JEE MAIN 2025 Foundation Course
NEET 2025 Foundation Course
CLASS 12 FOUNDATION COURSE
CLASS 10 FOUNDATION COURSE
CLASS 9 FOUNDATION COURSE
CLASS 8 FOUNDATION COURSE
0 votes
324 views
in Programming by (108k points)
closed by

Consider the relational schema given below, where eId of the relation dependent is a foreign

key referring to empId of the relation employee. Assume that every employee has at least one

associated dependent in the dependent relation.

Employee (empId, empName, empAge)

Dependent(depId, eId, depName, depAge)

Consider the following relational algebra query:

ΠempId(employee)-ΠempId (employee⋈(empId = eID)∧(empAge ≤ depAge)dependent)

The above query evaluates to the set of empIds of employees whose age is greater than that of
1. some dependent.
2. all dependents
3. some of his/her dependents
4. all of his/her dependents

1 Answer

0 votes
by (101k points)
selected by
 
Best answer
Correct Answer - Option 4 : all of his/her dependents

Explanation:

Example:

Employee Relation:

EmpID

empName

empAge

e1

A

20

e2

B

25

e3

C

24

 

Dependent Relation:

depID

eID

depName

Age

d1

e1

X

30

d2

e1

Y

25

d3

e1

Z

20

d4

e2

P

18

d5

e2

P

17

d7

e3

Z

35

 

R1=ΠempId (employee⋈(empId = eID)∧(empAge ≤ depAge)dependent)

Output : e1,e3

R2=ΠempId(employee)

Output: e1,e2,e3

R = R2 - R1= {e1,e2,e3} - {e1,e3} = e2

  • e2 is output that is saying that set of empIds of employees whose age is greater than that of all of his/her dependents.

Welcome to Sarthaks eConnect: A unique platform where students can interact with teachers/experts/students to get solutions to their queries. Students (upto class 10+2) preparing for All Government Exams, CBSE Board Exam, ICSE Board Exam, State Board Exam, JEE (Mains+Advance) and NEET can ask questions from any subject and get quick answers by subject teachers/ experts/mentors/students.

Categories

...