Relational Queries questions

Q25

GATE CS 2022 CSRelational QueriesMSQ1 mark
Consider the following three relations in a relational database.

Employee(eId‾,Name),Brand(bId‾,bName),Own(eId‾,bId‾)\text{Employee}(\underline{\text{eId}}, \text{Name}), \text{Brand}(\underline{\text{bId}}, \text{bName}), \text{Own}(\underline{\text{eId}}, \underline{\text{bId}})

Which of the following relational algebra expressions return the set of eIds who own all the brands?
More than one option can be correct.
Show answer without attempting

Answer: A, B

Q56

GATE CS 2022 CSRelational QueriesNAT2 marks
Consider the relational database with the following four schemas and their respective instances.

Student(sNo‾\underline{\text{sNo}}, sName, dNo) Dept(dNo‾\underline{\text{dNo}}, dName)
Course(cNo‾\underline{\text{cNo}}, cName, dNo) Register(sNo‾\underline{\text{sNo}}, cNo‾\underline{\text{cNo}})

Student
sNosNamedNo
S01JamesD01
S02RockyD01
S03JacksonD02
S04JaneD01
S05MilliD02
Dept
dNodName
D01CSE
D02EEE
Course
cNocNamedNo
C11DSD01
C12OSD01
C21DED02
C22PTD02
C23CVD03
Register
sNocNo
S01C11
S01C12
S02C11
S03C21
S03C22
S03C23
S04C11
S04C12
S05C11
S05C21
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___________.
Show answer without attempting

Answer: 2

0/20 correct0 marks

Related topics in Databases