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
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 Correct Answer 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.