Skip to content
GATEiit

GATE DA 2026 Q60: Rows returned by a correlated count comparison

Question

Let Account be a relation as shown.

Account
AccNoBalance
A15000
A25000
A310000
A415000
A518000
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)

Consider the SQL query above. The number of rows returned by the SQL query is __________. (Answer in integer)

Try it: numerical answer: type the value

Numerical answer. No negative marking.
Show answer and explanation

Answer: 3 (official GATE 2026 final answer key)

Concept used: Correlated subqueries: for each account, compare how many balances are higher with how many are lower.

First step: A1, A2: 3 higher, 0 lower; A3: 2 higher, 2 lower; A4: 1 higher, 3 lower; A5: 0 higher, 4 lower.

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 2026 DA question paper and final answer key, organised by IIT Guwahati. Question paper · Answer key