GATE CS 2025 (Afternoon) — Question 54

Database Management Systems (DBMS)SQL Queries (DDL/DML, Joins, Aggregations)MSQ2 marksMedium

Consider the following relational schema: Students (rollno: integer, name: string, age: integer, cgpa: real) Courses (courseno: integer, cname: string, credits: integer) Enrolled (rollno: integer, courseno: integer, grade: string) Which of the following options is/are correct SQL query/queries to retrieve the names of the students enrolled in course number (i.e., courseno) 1470?
  1. A
    SELECT S.name FROM Students S WHERE EXISTS (SELECT * FROM Enrolled E WHERE E.courseno = 1470 AND E.rollno = S.rollno);
  2. B
    SELECT S.name FROM Students S WHERE SIZEOF (SELECT * FROM Enrolled E WHERE E.courseno = 1470 AND E.rollno = S.rollno) > 0;
  3. C
    SELECT S.name FROM Students S WHERE 0 < (SELECT COUNT(*) FROM Enrolled E WHERE E.courseno = 1470 AND E.rollno = S.rollno);
  4. D
    SELECT S.name FROM Students S NATURAL JOIN Enrolled E WHERE E.courseno = 1470;
Practise the full 2025-AN paper
Challenge a friend: WhatsApp Telegram
From RENYXERAThis week's 10-question challengeSame 10 past-GATE questions for everyone this week — see where you stand.
Practise more on SQL Queries (DDL/DML, Joins, Aggregations)Timed, in the real exam interface · free to start

A GATE question every morning

One real past-paper question every morning for your branch, answer hidden until you tap. Free on Telegram.

Join
Stuck? Ask in the student group