GATE CSE · 2022 · CS
Question 56: Databases
Give it a try, then reveal the answer to check your work.
Question 56
CSNAT2 marksNeeds review
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)
Student
sNo | sName | dNo |
|---|---|---|
S01 | James | D01 |
S02 | Rocky | D01 |
S03 | Jackson | D02 |
S04 | Jane | D01 |
S05 | Milli | D02 |
Dept
dNo | dName |
|---|---|
D01 | CSE |
D02 | EE |
Course
cNo | cName | dNo |
|---|---|---|
C11 | DS | D01 |
C12 | OS | D01 |
C21 | DE | D02 |
C22 | PT | D02 |
C23 | CV | D03 |
Register
sNo | cNo |
|---|---|
S01 | C11 |
S01 | C12 |
S02 | C11 |
S03 | C21 |
S03 | C22 |
S03 | C23 |
S04 | C11 |
S04 | C12 |
S05 | C11 |
S05 | C21 |
SQL Query:
SELECT * FROM Student AS S WHERE NOT EXIST
(SELECT cNo FROM Course WHERE dNo = “D01”
EXCEPT
SELECT cNo FROM Register WHERE sNo = S.sNo)
The number of rows returned by the above SQL query is __________.
Log in to check the answer
You can attempt this question now. Sign in to view the answer key, explanations and discussion.Log in to check answerEXPLORE & PRACTISE
Paper and topic context
See where this question comes from and choose what to practise next.
2022CS
GATE CSE 2022 · Paper 1
Computer Science and Information Technology · Original paper archive
- Section
- Computer Science and Information Technology
- Question type
- Numerical answer (NAT)
- Marks
- 2 marks
Practise related topics
Explore more previous year questions using this question’s imported topic tags.
computer science
GATE CSE previous year questions
information technology
GATE CSE previous year questions
computing
GATE CSE previous year questions
databases
GATE CSE previous year questions
Comments
Ask a question, share your approach, or help someone understand.
Log in to view the discussion
You’re not logged in. Log in or create an account to see discussions and add comments.