GateAI
SQL

GATE CSE 2023 · Q61

NAT2 marksEasy

Time

Consider the following table named Student in a relational database. The primary key of this table is rollNum. The SQL query below is executed on this database.SELECT * FROM Student WHERE gender = 'F' AND marks > 65;The number of rows returned by the query is _________.

GATE CSE 2023 Q61 diagram

Your answerNumerical answer

Enter a value to check

Solution

Step-by-step verified solution

Official answer: 2

SQL

The query filters rows from the Student table based on the condition:

\text{gender} = \text{'F^{\prime}} \quad \text{AND} \quad \text{marks} > 65

Let us evaluate each tuple in the Student relation:

  1. rollNum = 1 (name = 'Naman', gender = 'M', marks = 62): gender is not 'F'. (False)

  2. rollNum = 2 (name = 'Aliya', gender = 'F', marks = 70): gender = 'F' and 70>6570 > 65. (True)

  3. rollNum = 3 (name = 'Aliya', gender = 'F', marks = 80): gender = 'F' and 80>6580 > 65. (True)

  4. rollNum = 4 (name = 'James', gender = 'M', marks = 82): gender is not 'F'. (False)

  5. rollNum = 5 (name = 'Swati', gender = 'F', marks = 65): marks is equal to 6565, not strictly greater than 6565. (False)

Thus, only 22 rows (rollNum 2 and 3) satisfy both conditions.

The number of rows returned by the query is 2.

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 SQL previous year question is Q61 of the GATE CSE 2023 paper. Find more GATE CSE PYQs on 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 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.

SQL in GATE CSE

SQL has 17 GATE CSE PYQs across 14 papers from 2011 to 2025. 5 of them are 2-mark NAT questions like this one, and it is the only one in GATE CSE 2023.

How GATE tests SQL

More from GATE CSE 2023

Share this solution

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

GateAI solution cardGATE CSE 2023 · Q61 · NAT

Consider the following table named Student in a relational database. The primary key of this table is rollNum . The SQL query below is executed on this database. SELECT * FROM Student WHERE gender = 'F' AND marks > 65; The number of rows returned by the query is …

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.