The relation schema, Person(pid, city), describes the city of residence for every person uniquely identified by pid. The following relational algebra operators are available: selection, projection, cross product, and rename. To find the list of cities where at least 3 persons reside, using the above operators, the minimum number of cross product operations that must be used is
- A1
- 2
- C3
- D4
Explanation
Without aggregation/group-by, "at least 3 persons share a city" must be expressed by comparing THREE independently-renamed copies of Person (say P1, P2, P3) on the same city with pairwise-distinct pids, then projecting city. Combining 3 relations requires exactly n−1 = 2 binary cross-product operations.
Source: GATE CS 2024 Session 2 (CS2) (2024)
This question is part of a 15-day revision cycle — sign in and Project Forge will bring it back the day before you'd forget it.