Correct option is B
The Cartesian Product of two relations combines every tuple from one relation with every tuple from the other relation, resulting in all possible combinations.
The formula to calculate the cardinality (number of tuples) of the Cartesian product is:
∣R × S∣ = ∣R∣ × ∣S∣
Given:
· ∣R∣ = 5: Relation R has 5 tuples.
· ∣S∣ = 3: Relation S has 3 tuples.
Now, applying the formula:
∣R × S∣ = 5 × 3 = 15
So, the result of the Cartesian product R × S will contain 15 tuples.
Example: Let:
· Relation R = { r1, r2, r3, r4, r5}
· Relation S = { s1, s2, s3}
The Cartesian Product R × S results in:
· {(r1, s1), (r1, s2), (r1, s3), …, (r5, s3)}
Total combinations: 5 × 3 = 15.
Important Key Points:
1. Cartesian Product combines every tuple in R with every tuple in S, producing a set of ordered pairs.
2. It forms the basis for other operations like Join, where conditions are applied on the product to filter results.
3. The result of a Cartesian Product can grow very large, especially when both relations have a high number of tuples.
Knowledge Booster:
· Reducing size with selection or join: After the Cartesian Product, a Selection or Join operation is applied to filter tuples based on conditions. Example:
σR.attr = S.attr(R × S)
This selects only the tuples where R.attr equals S.attr, resulting in fewer tuples.
· Practical Use: While Cartesian Product by itself is rarely used in queries, it is an intermediate step in complex queries involving joins.