Assume two relations $R(P,Q)$ and $S(X,Y)$.
Consider the following TRC query:
\[
\{\,u \mid \exists v \exists w \ ((u,v) \in R \ \land\ (v,w) \in S)\,\}
\]
Which of the following relational algebra queries is equivalent to the above?
- $\pi_{P}\!\left(S \bowtie_{S.Y=R.Q} R\right)$
- $\pi_{P}\!\left(R \bowtie_{R.P=S.X} S\right)$
- $\pi_{P}\!\left(R \bowtie_{R.Q=S.X} S\right)$
- $\pi_{P}\!\left(S \bowtie_{S.Y=R.P} R\right)$