Consider the following relations and
How many tuples does the result of the following relational algebra expression contain? Assume that the schema of is the same as that of .
View worked solution
Answer: A
First, we find the relation . Since union eliminates duplicate tuples, we get:
Relation is given as:
The join condition is . We evaluate this condition for each pair in the Cartesian product :
- For the tuple in with : Since , the condition is True. Thus, the disjunction is satisfied for all tuples of . This contributes tuples to the result.
- For the tuple in with : Since , the condition is False. The overall condition simplifies to . The tuples in satisfying this are those with and . This contributes tuples to the result.
Total number of tuples in the result = .
Free practice · Your answers on this page are not saved.
