Discussion
Consider a relational database schema with two relations R(P, Q) and S(X, Y).
Let \[ \begin{aligned} E = \{\langle u\rangle \mid\ & \exists v\, \exists w\ \langle u, v\rangle \in R \\ & \wedge \langle v, w\rangle \in S\} \end{aligned} \] be a tuple relational calculus expression.
Which one of the following relational algebraic expressions is equivalent to E ?
Answer: B
The equivalent expression is \(\Pi_{P}(S \bowtie_{S.X=R.Q} R)\).
E returns each u such that some tuple \(\langle u, v\rangle\) is in R and some tuple \(\langle v, w\rangle\) is in S. The shared variable v is R's second attribute Q and S's first attribute X, so the join condition is R.Q = S.X, and the result keeps u, which is R.P.
Joins are commutative, so writing S first does not matter. The other options join on R.P, S.Y or a different pairing, each linking the wrong attributes: R.P = S.X matches u with S's first attribute, and S.Y = R.Q links v to S's second attribute.
Post your comment
Please log in or register to post a comment.
Examination Categories
- SSC Exams
- Banking Exams
- Teaching Exams
- Civil Services Exams
- Railways Exams
- Engineering Recruitment Exams
- Defence Exams
- State Government Exams
- Police Exams
- Insurance Exams
- Nursing Exams
- Other Government Exams
- NRA CET
- PG Entrance Exams
- Campus Placement
- MBA Entrance Exams
- CUET and UG Entrance
- Judiciary Exams
- Regulatory Body Exams
- Software Development