Consider the relations and , where is a primary key and is a foreign key referencing . Consider the query
Let LOJ denote the natural left outer-join operation. Assume that and contain no null values.
Which of the following is NOT equivalent to ?
View worked solution
Answer: C
The query returns only those tuples from and where the join attribute . Any tuple in with is completely excluded from the result.
Let us analyze why Option C is NOT equivalent to :
- In , the right relation contains only tuples with .
- For any tuple in with , there is no matching tuple in the right relation.
- Since it is a Left Outer Join (LOJ), these unmatched tuples from (where ) are still preserved in the final output, padded with for attribute .
- Thus, the result of Option C contains tuples with , whereas does not.
For the other options, since is a foreign key referencing the primary key and there are no nulls, every tuple in has a unique matching tuple in . Therefore, . This makes options A, B, and D equivalent to :
- A: (Standard selection push-down).
- B: .
- D: .
Free practice · Your answers on this page are not saved.
