GateAI
Relational Model and SQL

GATE CSE 2011 · Q46

MCQ2 marksEasy

Time

Database table by name Loan_Records is given below. What is the output of the following SQL query?SELECT count(*) FROM ( (SELECT Borrower, Bank_Manager FROM Loan_Records) AS S NATURAL JOIN (SELECT Bank_Manager, Loan_Amount FROM Loan_Records) AS T );

GATE CSE 2011 Q46 diagram

Select one answerSingle correct

Pick an option to check

Solution

Step-by-step verified solution

Official answer: C) 5

Relational Model and SQL

Let us evaluate the subqueries:

  1. Table SS (Borrower, Bank_Manager):

    • (Ramesh, Sunderajan)

    • (Suresh, Ramgopal)

    • (Mahesh, Sunderajan)

  2. Table TT (Bank_Manager, Loan_Amount):

    • (Sunderajan, 10000.00)

    • (Ramgopal, 5000.00)

    • (Sunderajan, 7000.00)

  3. Natural Join on Bank_Manager:

    • For Bank_Manager = 'Sunderajan': Table SS has 2 rows and Table TT has 2 rows, producing 2×2=42 \times 2 = 4 tuples:

      • (Ramesh, Sunderajan, 10000.00)

      • (Ramesh, Sunderajan, 7000.00)

      • (Mahesh, Sunderajan, 10000.00)

      • (Mahesh, Sunderajan, 7000.00)

    • For Bank_Manager = 'Ramgopal': Table SS has 1 row and Table TT has 1 row, producing 1×1=11 \times 1 = 1 tuple:

      • (Suresh, Ramgopal, 5000.00)

  4. Total row count:

    Total rows=4+1=5\text{Total rows} = 4 + 1 = 5

Thus, SELECT count(*) returns 5 (Option C).

Try the question first, then check your work.

Think the official key or this write-up is wrong?

Report error or challenge

Examiner trap

The misconception this question tests

This Relational Model and SQL previous year question is Q46 of the GATE CSE 2011 paper. Find more GATE CSE PYQs on Relational Model and SQL in Databases, or browse all GATE CSE PYQs.

Free diagnostic

Where do you stand for GATE?

Take the 20-minute diagnostic: the 3 topics that cost you the most marks, and a rank range. Or sit 5 related Relational Model and SQL PYQs now with no account.

One GATE CSE PYQ every morning

An official question by email at 7 AM IST, with a link to its verified solution. Unsubscribe in one click.

Relational Model and SQL in GATE CSE

Relational Model and SQL has 15 GATE CSE PYQs across 12 papers from 2011 to 2026. 8 of them are 2-mark MCQs like this one, and it is the only one in GATE CSE 2011.

How GATE tests Relational Model and SQL

More from GATE CSE 2011

Share this solution

A plain-text card for WhatsApp or Telegram study groups.

GateAI solution cardGATE CSE 2011 · Q46 · MCQ

Database table by name LoanRecords is given below. What is the output of the following SQL query? SELECT count(*) FROM ( (SELECT Borrower, BankManager FROM LoanRecords) AS S NATURAL JOIN (SELECT BankManager, LoanAmount FROM LoanRecords) AS T );

Topic-wise GATE CS PYQs with verified steps

Independent practice explanation verified by the GateAI team. GATE is conducted by the IITs; question text follows the official paper.