Consider the relational schema given below, where eId of the relation dependent is a foreign key referring to empId of the relation employee. Assume t

180 views

closed

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

by (41.0k points)
selected

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.