NAT2 marks
Consider a relational database schema with a relation . If and are the only two candidate keys of the relation , then the number of superkeys of relation is ______. (*answer in integer*)
Numerical answer
GATE CSE previous year questions · DBMS
Numerical answer
player(pid,pname,age) team(tid,tname,city,cid)
coach(cid,cname) members(pid,tid)
An instance of the table and an SQL query are given.
player coach team members
pid pname age cid cname tid tname city cid pid tid
1 Jasprit 31 101 Ricky 10 MI Mumbai 102 1 10
2 Atharva 24 102 Mark 20 DC Delhi 101 2 30
3 Ishan 26 103 Trevor 30 PK Mohali 103 3 10
4 Axar 30 4 20
SELECT MIN(P.age)
FROM player P
WHERE P.pid IN (
SELECT M.pid
FROM team T, coach C, members M
WHERE C.cname = 'Mark'
AND T.cid = C.cid
AND M.tid = T.tid
)
The value returned by the given SQL query is ______. (Answer in integer)Numerical answer
Numerical answer

Numerical answer
Numerical answer
Student
rollNum name gender marks
1 Naman M 62
2 Aliya F 70
3 Aliya F 80
4 James M 82
5 Swati F 65
The SQL query below is executed on this database.
SELECT *
FROM Student
WHERE gender = 'F' AND
marks > 65;
The number of rows returned by the query is __________Numerical answer
Answer key coming soon

Numerical answer
Answer key coming soon
Numerical answer
Answer key coming soon
Student(sNo, sName, dNo) Dept(dNo, dName) Course(cNo, cName, dNo) Register(sNo, cNo)
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 __________
Numerical answer
Answer key coming soon
Numerical answer
Answer key coming soon
RollNo. The size of a record pointer for this disk is 7 bytes. Each student-record has a candidate key attribute called ANum of size 12 bytes. Suppose an index file with records consisting of two fields, ANum value and the record pointer to the corresponding student record, is built and stored on the same disk. Assume that the records of data file and index file are not split across disk blocks. The number of blocks in the index file is __________.Numerical answer
Answer key coming soon
Numerical answer
Answer key coming soon
SELECT S.Student_name, sum(P.Marks)
FROM Student S, Performance P
WHERE P.Marks > 84
GROUP BY S.Student_name;
The number of rows returned by the above SQL query is _____.
Numerical answer

Numerical answer
EMP
EmpId EmpName DeptName
1 XYA AA
2 XYB AA
3 XYC AA
4 XYD AA
5 XYE AB
6 XYF AB
7 XYG AB
8 XYH AC
9 XYI AC
10 XYJ AC
11 XYK AD
12 XYL AD
13 XYM AE
SELECT AVG(EC.Num)
FROM EC
WHERE (DeptName, Num) IN
(SELECT DeptName, COUNT(EmpId) AS
EC(DeptName, Num)
FROM EMP
GROUP BY DeptName)
The output of executing the SQL query is ________.Numerical answer
Answer key coming soon
CR
StudentName CourseName
SA CA
SA CB
SA CC
SB CB
SB CC
SC CA
SC CB
SC CC
SD CA
SD CB
SD CC
SD CD
SE CD
SE CA
SE CB
SF CA
SF CB
SF CC
The following query is made on the database.
The number of rows in is ________.Numerical answer
Answer key coming soon
T1 T2
P Q R S
2 2 2 2
3 8 8 3
7 3 3 2
5 8 9 7
6 9 5 7
8 5 7 2
9 8
In table T1, P is the primary key and Q is the foreign key referencing R in table T2 with on-delete cascade and on-update cascade. In table T2, R is the primary key and S is the foreign key referencing P in table T1 with on-delete set NULL and on-update cascade. In order to delete record from table T1, the number of additional records that need to be deleted from table T1 is ________.Numerical answer
Answer key coming soon
Numerical answer
Answer key coming soon
top_scorer
player country goals
Klose Germany 16
Ronaldo Brazil 15
G Müller Germany 14
Fontaine France 13
Pelé Brazil 12
Klinsmann Germany 11
Kocsis Hungary 11
Batistuta Argentina 10
Cubillas Peru 10
Lato Poland 10
Lineker England 10
T Müller Germany 10
Rahn Germany 10
Consider the following SQL query:
SELECT ta.player FROM top_scorer AS ta
WHERE ta.goals >ALL (SELECT tb.goals
FROM top_scorer AS tb
WHERE tb.country = 'Spain')
AND ta.goals >ANY (SELECT tc.goals
FROM top_scorer AS tc
WHERE tc.country = 'Germany')
The number of tuples returned by the above SQL query is ________.Numerical answer
Answer key coming soon
Numerical answer
Answer key coming soon