GATE CS 2022 (Forenoon) — Question 56

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

Consider the relational database with the following four schemas and their respective instances. Student(sNo, sName, dNo) Dept(dNo, dName) Course(cNo, cName, dNo) Register(sNo, cNo)
Question image
SQL Query:
sql
1SELECT * FROM Student AS S WHERE NOT EXIST
2    (SELECT cNo FROM Course WHERE dNo = "D01"
3     EXCEPT
4     SELECT cNo FROM Register WHERE sNo = S.sNo)
5
The number of rows returned by the above SQL query is ___________.
Practise the full 2022-FN paper
Challenge a friend: WhatsApp Telegram
Recommended book · affiliate linkDatabase System Concepts (Korth)Normalisation, SQL, transactions and indexing — the DBMS syllabus in one book.
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