Skip to content
Q42Section DA (Data Science and Artificial Intelligence (Q11–Q65))42 of 65

Evaluating a filtered join-based relational algebra expression

Consider the given relations XX, YY and ZZ. The relation XX has three columns PP, QQ and RR. The relation YY has three columns PP, QQ and SS. The relation ZZ has two columns PP and TT.

| X.PX.P | X.QX.Q | X.RX.R | |—|—|—| | P1 | Q1 | R1 | | P2 | Q2 | R2 | | P3 | Q3 | R2 |

| Y.PY.P | Y.QY.Q | Y.SY.S | |—|—|—| | P1 | Q1 | 2 | | P1 | Q2 | 5 | | P2 | Q1 | 6 | | P3 | Q3 | 1 |

| Z.PZ.P | Z.TZ.T | |—|—| | P1 | T1 | | P3 | T2 | | P4 | T3 | | P4 | NULL |

Consider the relational algebra expression ∏PRS[(σ(Q=Q3∨R=R2)[X⋈Y])⋈(σ(S>1)[Y⋈Z])]\prod_{PRS}\left[\left(\sigma_{(Q = Q3 \vee R = R2)}[X \Join Y]\right) \Join \left(\sigma_{(S > 1)}[Y \Join Z]\right)\right] where ⋈\Join denotes natural join operation. Which of the following options is the correct output for the given expression?

Options

Pick an option to check your answer. In a mock test a wrong answer here costs 2/3 mark.