Consider the following relations and .
How many tuples will be returned by the following relational algebra query?
Answer: ________
How many tuples will be returned by the following relational algebra query?
Answer: ________
GATE CSE 2019Databases › Relational Algebra & CalculusVerified
1
Evaluate the two relational-algebra expressions separately. Each is a join of two tables, filtered by a conjunction of predicates, then projected onto X. Because projection is a set operation, duplicate X values collapse; the final result is the set difference of the two projected sets, and the asked quantity is its cardinality.
The first projection contributes the single value X2 and the second contributes the single value X1; removing the latter from the former leaves the one-element set {X2}. The number of tuples returned by the query is therefore 1.
Reviewed by GateIQ Editorial Team: IIT & IISc Alumni.