in Databases retagged by
430 views
3 votes
3 votes

$\sigma_{A=B \text{ and } B=C \text{ and } C=A} \bigg( \Pi_A (R) \times \Pi_B (R) \times \Pi_C (R) \bigg)$

The number of rows returned by the above relational algebraic expression is ________.

in Databases retagged by
by
430 views

2 Answers

7 votes
7 votes
Best answer
As projection in RA operator  eliminates duplicates automatically so only one tuple will be displayed which is 1 .
selected by

3 Comments

@ Bikram Sir

Had this been SQL query it would have returned 12 rows?
2
2
@Kiran Yes I think so.
0
0
0
0
0 votes
0 votes

ΠA(R)  → {1,2}

ΠB(R)  → {1,2}

ΠA(C)  → {1}

So, 

(ΠA(R)×ΠB(R)×ΠC(R)) → {1,2} * {1,2} * {1}

                                        → {(1,1,1),(1,2,1),(2,1,1),(2,2,1)}

 

σA=B and B=C and C=A(ΠA(R)×ΠB(R)×ΠC(R))  → {(1,1,1)}

 

Hence, 1 row will be returned.

Answer:

Related questions