Skip to content
GATEiit

GATE DA 2024 Q31: Rows returned by a join with filters on two tables

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.

Raider
IDNameRaidsRaidPoints
1Arjun200250
2Ankush190219
3Sunil150200
4Reza150190
5Pratham175220
6Gopal193215
Team
CityIDBidPoints
Jaipur2200
Patna3195
Hyderabad5175
Jaipur1250
Patna4200
Jaipur6200
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

Numerical answer. No negative marking.
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

WhatsAppDownload image

Source: official GATE 2024 DA question paper and final answer key, organised by IISc Bangalore. Question paper · Answer key