The GATE Grind

GATE 2024 DA – Question 31

Database Management and Warehousing · Relational algebra, tuple calculus and SQL · 1 mark · Numerical answer

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

The SQL query described below is executed on this database:

SELECT *
FROM Raider, Team
WHERE Raider.ID=Team.ID AND City="Jaipur" AND
RaidPoints > 200;

The number of rows returned by this query is ______.

Practise this question in The GATE Grind →

Show answer and explanation

Correct answer: 3

Explanation

The Team rows in Jaipur have the IDs 2, 1 and 6. The raiders with these IDs have RaidPoints 219, 250 and 215, all more than 200. So all 3 joined rows qualify.