Database Management System

Question 1
Suppose the following functional dependencies hold on a relation U with attributes P, Q, R, S, \text{ and } T:

P \rightarrow QR \\ RS \rightarrow T

Which of the following functional dependencies can be inferred from the above functional dependencies?
[MSQ]
A
PS \rightarrow T
B
R \rightarrow T
C
P \rightarrow R
D
PS \rightarrow Q
GATE CSE 2021 SET-2      Normal Form
Question 2
Let S be the following schedule of operations of three transactions T_1, T_2 \text{ and }T_3 in a relational database system:

R_2(Y), R_1(X), R_3(Z), R_1(Y)W_1(X), R_2(Z), W_2(Y), R_3(X), W_3(Z)

Consider the statements P and Q below:

P: S is conflict-serializable.
Q: If T_3 commits before T_1 finishes, then S is recoverable.

Which one of the following choices is correct?
A
Both P and Q are true
B
P is true and Q is false
C
P is false and Q is true
D
Both P and Q are false
GATE CSE 2021 SET-2      Transaction
Question 3
The relation scheme given below is used to store information about the employees of a company, where empId is the key and deptId indicates the department to which the employee is assigned. Each employee is assigned to exactly one department.

\textsf{emp($\underline{\textsf{empId}}$, name, gender, salary, deptId)}

Consider the following SQL query:
 select deptId, count(*)
from emp
where gender = "female" and salary > (select avg(salary)from emp)
group by deptId;
The above query gives, for each department in the company, the number of female employees whose salary is greater than the average salary of
A
employees in the department
B
employees in the company
C
female employees in the department
D
female employees in the company
GATE CSE 2021 SET-2      SQL
Question 4
A data file consisting of 1,50,000 student-records is stored on a hard disk with block size of 4096 bytes. The data file is sorted on the primary key 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 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 ______
A
235
B
248
C
488
D
698
GATE CSE 2021 SET-2      File System
Question 5
Consider the following statements S1 and S2 about the relational data model:

S1: A relation scheme can have at most one foreign key.
S2: A foreign key in a relation scheme R cannot be used to refer to tuples of R.

Which one of the following choices is correct?
A
Both S1 and S2 are true
B
S1 is true and S2 is false
C
S1 is false and S2 is true
D
Both S1 and S2 are false
GATE CSE 2021 SET-2      Relational Schema
Question 6
Consider the relation R(P,Q,S,T,X,Y,Z,W) with the following functional dependencies.

PQ\rightarrow X;\quad P\rightarrow YX;\quad Q\rightarrow Y; \quad Y\rightarrow ZW

Consider the decomposition of the relation R into the constituent relations according to the following two decomposition schemes.

D1:\quad R=[(P,QS,T);\;(P,T,X);\;(Q,Y);\;(Y,Z,W)]
D2:\quad R=[(P,Q,S);\;(T,X);\;(Q,Y);\;(Y,Z,W)]

Which one of the following options is correct?
A
D1 is a lossless decomposition, but D2 is a lossy decomposition.
B
D1 is a lossy decomposition, but D2 is a lossless decomposition.
C
Both D1 and D2 are lossless decompositions.
D
Both D1 and D2 are lossy decompositions.
GATE CSE 2021 SET-1      Relational Schema
Question 7
Let r_i(z) and w_i(z) denote read and write operations respectively on a data item z by a transaction T_i. Consider the following two schedules.

S1: r_1(x)r_1(y)r_2(x)r_2(y)w_2(y)w_1(x)
S2: r_1(x)r_2(x)r_2(y)w_2(y)r_1(y)w_1(x)

Which one of the following options is correct?
A
S1 is conflict serializable, and S2 is not conflict serializable
B
S1 is not conflict serializable, and S2 is conflict serializable
C
Both S1 and S2 are conflict serializable
D
Niether S1 nor S2 is conflict serializable
GATE CSE 2021 SET-1      Transaction
Question 8
The following relation records the age of 500 employees of a company, where empNo ( indicating the employee number) is the key:

empAge(\underline{empNo},age)

Consider the following relational algebra expression:

\Pi_{empNo}(empAge \Join_{(age > age1)} \rho_{empNo1,age1}(empAge))

What does the above expression generate?
A
Employee numbers of only those employees whose age is the maximum
B
Employee numbers of only those employees whose age is more than the age of exactly one other employee
C
Employee numbers of all employees whose age is not the minimum
D
Employee numbers of all employees whose age is the minimum
GATE CSE 2021 SET-1      Relational Algebra
Question 9
A relation r(A,B) in a relational database has 1200 tuples. The attribute A has integer values ranging from 6 to 20, and the attribute B has integer values ranging from 1 to 20. Assume that the attributes A and B are independently distributed.

The estimated number of tuples in the output of \sigma _{(A > 10)\vee(B=18)}(r) is ____________
A
1200
B
205
C
15
D
820
GATE CSE 2021 SET-1      Tuple Calculus
Question 10
Consider a linear list based directory implementation in a file system. Each directory is a list of nodes, where each node contains the file name along with the file metadata, such as the list of pointers to the data blocks. Consider a given directory foo.

Which of the following operations will necessarily require a full scan of foo for successful completion?
[MSQ]
A
Creation of a new file in foo
B
Deletion of an existing file from foo
C
Renaming of an existing file in foo
D
Opening of an existing file in foo
GATE CSE 2021 SET-1      File System


There are 10 questions to complete.

Leave a Comment

Like this FREE website? Please share it among all your friends and join the campaign of FREE Education to ALL.