Reputation: 2646
I'm trying to finish quiz on Stanford website, it's part of mini course on relational algebra. It goes something like this:
Consider a relation R(A,B) with r tuples, all unique within R, and a relation S(B,C) with s tuples, all unique within S. Let t represent the number of tuples in R natural-join S. Which of the following triples of values (r,s,t) is possible?
1. (5,10,250)
2. (5,10,500)
3. (2,3,9)
4. (2,10,0)
Can someone tell me the right solution and explain why is it the right solution? Thanks.
Upvotes: 1
Views: 5414
Reputation: 2806
The number of tuples resulting from Natural Join can't be more than the product of the numbers of tuples in each operand. (Natural Join is often described as a filter on the cross-product, for example here: https://en.wikipedia.org/wiki/Relational_algebra#Natural_join_.28.E2.8B.88.29.)
So that rules out answers 1. to 3., leaving 4. as the only possible.
Upvotes: 2