Filter by year

SQL questions

Q51

GATE DA 2026 DARelational Query LanguagesMSQ2 marks

Report a problem with Q51

What is wrong?
Consider a table Employee(EmpID, TeamID), where the column EmpID (ID of an employee) is the primary key. The column TeamID denotes the team ID of the team of which the employee is a member. TeamID is a NOT NULL column.
We want to display the size of the team (denoted as TeamSize) in which each employee is a member by using SQL. As an example, the desired output for the given Employee table is also shown in tabular form.
Which of the following is/are correct?

Employee
EmpIDTeamID
18
28
38
47
57
69
Output
EmpIDTeamSize
13
23
33
42
52
61
More than one option can be correct.
Show answer without attempting

Loading the answer…

Q60

GATE DA 2026 DARelational Query LanguagesNAT2 marks

Report a problem with Q60

What is wrong?
Let Account be a relation as shown.

Account
AccNoBalance
A15000
A25000
A310000
A415000
A518000
Consider the given SQL query.
SELECT AccNo FROM Account AS A
WHERE (SELECT COUNT(*) FROM Account AS B
WHERE A.Balance < B.Balance) >= (SELECT COUNT(*)
FROM Account AS C WHERE A.Balance > C.Balance)
The number of rows returned by the SQL query is __________ . (Answer in integer)
Show answer without attempting

Loading the answer…

Q33

GATE DA 2025 DARelational Query LanguagesNAT1 mark

Report a problem with Q33

What is wrong?
On a relation named Loan of a bank:
loan_numberbranch_nameamount
L11Banjara Hills90000
L14Kondapur50000
L15SR Nagar40000
L22SR Nagar25000
L23Balanagar80000
L25Kondapur70000
L19SR Nagar65000
the following SQL query is executed:
SELECT L1.loan_number
FROM Loan L1
WHERE L1.amount > (SELECT MAX (L2.amount)
                   FROM Loan L2
                   WHERE L2.branch_name = 'SR Nagar');
The number of rows returned by the query is __________ (Answer in integer)
Show answer without attempting

Loading the answer…

Q31

GATE DA 2024 DARelational Query LanguagesNAT1 mark

Report a problem with Q31

What is wrong?
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 ______.
Show answer without attempting

Loading the answer…

0/40 correct0 marks

Related topics in Relational Query Languages