Skip to content
Related Articles
Get the best out of our app
GeeksforGeeks App
Open App
geeksforgeeks
Browser
Continue

Related Articles

GATE | GATE-CS-2014-(Set-3) | Question 65

Improve Article
Save Article
Like Article
Improve Article
Save Article
Like Article

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:

GATECS2014Q40
The above query evaluates to the set of empIds of employees whose age is greater than that of

(A) some dependent.
(B) all dependents.
(C) some of his/her dependents
(D) all of his/her dependents.


Answer: (D)

Explanation: The below subquery after the subtraction sign produces id’s of those employees who have at least one dependent with age greater than or equal the employee’s age.

GATECS2014Q40 

When the result of above subquery is subtracted from all employees, we get the employees whose age is greater than all dependents.

Quiz of this Question

My Personal Notes arrow_drop_up
Last Updated : 28 Jun, 2021
Like Article
Save Article
Similar Reads