Skip to content
GATEiit

GATE CSE 2023 Q61: Rows returned by SELECT with gender = 'F' AND marks > 65

Question

Consider the following table named Student in a relational database. The primary key of this table is rollNum. The SQL query shown below the table is executed on this database.

Student
rollNumnamegendermarks
1NamanM62
2AliyaF70
3AliyaF80
4JamesM82
5SwatiF65
SELECT *
FROM Student
WHERE gender = 'F' AND
      marks > 65;

The number of rows returned by the query is _______.

Try it: numerical answer: type the value

Numerical answer. No negative marking.
Show answer and explanation

Answer: 2 (official GATE 2023 final answer key)

Concept used: A WHERE clause keeps exactly the rows that satisfy every condition joined by AND.

First step: Keep the rows with gender F, then drop those whose marks are not strictly greater than 65.

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 2023 CS question paper and final answer key, organised by IIT Kanpur. Question paper · Answer key