GATE CS 2024 Set 2 — Question 45
MCQ+2 / -0.67HardSelection & ProjectionRelational ModelDatabases
Databases → Relational Model → Selection & Projection
Last updated
Question
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 isA.
1
B.
2
C.
3
D.
4
Correct answer
(B) 2
Solution
To find cities with at least 3 persons, we need to find three distinct persons such that they all live in the same city.
In relational algebra, this is achieved by joining the
Since we need to combine 3 tables, we require cross product operations.
In relational algebra, this is achieved by joining the
Person relation with itself. Since only cross product (Cartesian product) is available (along with selection and projection), we perform the join manually.We need 3 instances of the Person relation, say .1.Perform . This is the 1st cross product.
2.Perform . This is the 2nd cross product.
After obtaining , we apply selection to ensure:projection to get the city.Since we need to combine 3 tables, we require cross product operations.
More questions on Relational Model
2024 Set 2 Q19Once the DBMS informs the user that a transaction has been successfully completed, its effect…2024 Set 1 Q20Let S be the specification: "Instructors teach courses. Students register for courses. Courses are…2024 Set 2 Q20In the context of owner and weak entity sets in the ER (Entity-Relationship) data model, which one…2024 Set 1 Q21In a tree, the requirement of at least half-full (50%) node occupancy is relaxed for which…2024 Set 1 Q22Which of the following statements about a relation in first normal form (1NF) is/are…
Practice GATE CS PYQs with adaptive difficulty
Timed practice, skill tracking, and AI explanations — free to start.
Start practicing free