GATE DA 2024 Q31: Rows returned by a join with filters on two tables
- Database Management and Warehousing
- 1 mark
- NAT
- No negative marking
Question
Consider the following two tables named Raider and Team in a relational database maintained by a Kabaddi league. The attribute ID in table Team references the primary key of the Raider table, ID.
| ID | Name | Raids | RaidPoints |
|---|---|---|---|
| 1 | Arjun | 200 | 250 |
| 2 | Ankush | 190 | 219 |
| 3 | Sunil | 150 | 200 |
| 4 | Reza | 150 | 190 |
| 5 | Pratham | 175 | 220 |
| 6 | Gopal | 193 | 215 |
| City | ID | BidPoints |
|---|---|---|
| Jaipur | 2 | 200 |
| Patna | 3 | 195 |
| Hyderabad | 5 | 175 |
| Jaipur | 1 | 250 |
| Patna | 4 | 200 |
| Jaipur | 6 | 200 |
SELECT *
FROM Raider, Team
WHERE Raider.ID=Team.ID AND City="Jaipur" AND
RaidPoints > 200;The SQL query above is executed on this database. The number of rows returned by this query is ______.
Try it: numerical answer: type the value
Show answer and explanation
Answer: 3 (official GATE 2024 final answer key)
Concept used: Equi-join followed by selection conditions.
First step: The Jaipur rows have IDs 2, 1 and 6; check each one's RaidPoints in Raider against 200.
Full step-by-step solution
Detailed working, common mistakes and linked mock tests will be available with a free GATEiit account. Log-in is coming soon.
Share this question
Source: official GATE 2024 DA question paper and final answer key, organised by IISc Bangalore. Question paper · Answer key
More Database Management and Warehousing PYQs
- 2026 · Q17Candidate keys from functional dependencies
- 2026 · Q18OLAP operation from Country to State
- 2026 · Q26Operations that never violate a foreign key
- 2026 · Q32Order of a B+ tree non-leaf node
- 2026 · Q41B+ tree root after inserting 3
- 2026 · Q42Output of a relational algebra expression with natural joins