Crack
GATE
C
G
Topic
Databases
70 questions
0
/ 70 done
Questions per paper
All
MCQ
MSQ
NAT
2015 to 2026. Point at a year to read it.
0
1
2
3
4
5
6
2015
2019
2021
2023
2025
2026
Show as a table
Year
All
MCQ
MSQ
NAT
2015
4
2.7
0
1.3
2018
0
0
0
0
2019
5
3
0
2
2020
5
4
0
1
2021
5
3
1
1
2022
5
2
1
2
2023
3
1
0
2
2024
6
2.5
2.5
1
2025
5
1
3
1
2026
4
2.5
1
0.5
1
CS 2026 Set 1 · 1 mark · MSQ · Moderate
Let
P
,
Q
,
R
P, Q, R
P
,
Q
,
R
and
S
S
S
be the attributes of a relation in a relational schema. Let
X
→
Y
X \rightarrow Y
X
→
Y
indicate functional dependency in the context of a relational database, where
X
,
Y
⊆
{
P
,
Q
,
R
,
S
}
X, Y \subseteq \{P, Q, R, S\}
X
,
Y
⊆
{
P
,
Q
,
R
,
S
}
.
2
CS 2026 Set 1 · 1 mark · MSQ · Moderate
In the context of relational database normalization, which of the following statements is/are true?
3
CS 2026 Set 1 · 2 marks · MCQ · Easy
Consider a relational database schema with two relations
R
(
P
,
Q
)
R(P, Q)
R
(
P
,
Q
)
and
S
(
X
,
Y
)
S(X, Y)
S
(
X
,
Y
)
.
4
CS 2026 Set 1 · 2 marks · NAT · Moderate
Consider a relational database schema with a relation
R
(
A
,
B
,
C
,
D
)
R(A, B, C, D)
R
(
A
,
B
,
C
,
D
)
. If
{
A
,
B
}
\{A, B\}
{
A
,
B
}
and
{
A
,
C
}
\{A, C\}
{
A
,
C
}
are the only two candidate keys of the relation
R
R
R
, then the number of superkeys of relation
R
R
R
is ____. (answer in integer)
5
CS 2026 Set 2 · 1 mark · MCQ · Easy
In the context of DBMS, consider the two sets
T
\mathbf{T}
T
and
S
\mathbf{S}
S
given below.
6
CS 2026 Set 2 · 1 mark · MCQ · Easy
Consider concurrent execution of two transactions
T
1
T_1
T
1
and
T
2
T_2
T
2
in a DBMS, both of which access a data object
A
A
A
. For these two transactions to not conflict on
A
A
A
, which one of the following statements must be true?
7
CS 2026 Set 2 · 2 marks · MCQ · Moderate
In the context of schema normalization in relational DBMS, consider a set
F
F
F
of functional dependencies. The set of all functional dependencies implied by
F
F
F
is called the closure of
F
F
F
. To compute the closure of
F
F
F
, Armstrong's Axioms can be applied. Consider
X
X
X
,
Y
Y
Y
, and
Z
Z
Z
as sets of attributes over a relational schema. The three rules of Armstrong's Axioms are described as follows.
8
CS 2026 Set 2 · 2 marks · MCQ · Moderate
An index in a DBMS is said to be dense if an index entry appears for every search-key value in the indexed file. Otherwise it is called a sparse index. Consider the following two statements.
9
CS 2025 Set 1 · 1 mark · MCQ · Easy
A schedule of three database transactions
T
1
T_1
T
1
,
T
2
T_2
T
2
, and
T
3
T_3
T
3
is shown.
R
i
(
A
)
R_i(A)
R
i
(
A
)
and
W
i
(
A
)
W_i(A)
W
i
(
A
)
denote read and write of data item
A
A
A
by transaction
T
i
,
i
=
1
,
2
,
3
T_i, i = 1, 2, 3
T
i
,
i
=
1
,
2
,
3
. The transaction
T
1
T_1
T
1
aborts at the end. Which other transaction(s) will be required to be rolled back?
10
CS 2025 Set 1 · 1 mark · MSQ · Moderate
Consider the following
B
+
B^+
B
+
tree with
5
5
5
nodes, in which a node can store at most
3
3
3
key values. The value
23
23
23
is now inserted in the
B
+
B^+
B
+
tree. Which of the following option(s) is/are CORRECT?
11
CS 2025 Set 1 · 2 marks · MCQ · Easy
Consider two relations describing
teams
and
players
in a sports league:
12
CS 2025 Set 1 · 2 marks · MSQ · Moderate
Consider a relational schema
t
e
a
m
(
n
a
m
e
,
c
i
t
y
,
o
w
n
e
r
)
\mathit{team}(\mathit{name}, \mathit{city}, \mathit{owner})
team
(
name
,
city
,
owner
)
, with functional dependencies
{
n
a
m
e
→
c
i
t
y
,
n
a
m
e
→
o
w
n
e
r
}
\{\mathit{name} \to \mathit{city}, \mathit{name} \to \mathit{owner}\}
{
name
→
city
,
name
→
owner
}
.
13
CS 2025 Set 1 · 2 marks · NAT · Easy
Consider the following database tables of a sports league.
14
CS 2025 Set 2 · 1 mark · MSQ · Hard
An audit of a banking transactions system has found that on an earlier occasion, two joint holders of account
A
A
A
attempted simultaneous transfers of Rs. 10000 each from account
A
A
A
to account
B
B
B
. Both transactions read the same value, Rs. 11000, as the initial balance in
A
A
A
and were allowed to go through.
B
B
B
was credited Rs. 10000 twice.
A
A
A
was debited only once and ended up with a balance of Rs. 1000.
15
CS 2025 Set 2 · 2 marks · MSQ · Moderate
Consider the following relational schema along with all the functional dependencies that hold on them.
16
CS 2025 Set 2 · 2 marks · MSQ · Moderate
Consider the database transactions T1 and T2, and data items X and Y. Which of the schedule(s) is/are conflict serializable?
17
CS 2025 Set 2 · 2 marks · MSQ · Moderate
Consider the following relational schema:
18
CS 2025 Set 2 · 2 marks · NAT · Hard
In a
B
+
\mathrm{B^+}
B
+
- tree where each node can hold at most four key values, a root to leaf path consists of the following nodes:
19
CS 2024 Set 1 · 1 mark · MCQ · Moderate
Let
S
S
S
be the specification: "Instructors teach courses. Students register for courses. Courses are allocated classrooms. Instructors guide students." Which one of the following ER diagrams CORRECTLY represents
S
S
S
?
20
CS 2024 Set 1 · 1 mark · MCQ · Easy
In a B+ tree, the requirement of at least half-full (50%) node occupancy is relaxed for which one of the following cases?
21
CS 2024 Set 1 · 1 mark · MSQ · Easy
Which of the following statements about a relation
R
R
R
in first normal form (1NF) is/are TRUE?
22
CS 2024 Set 1 · 1 mark · NAT · Easy
Consider the following two relations,
R
(
A
,
B
)
R(A, B)
R
(
A
,
B
)
and
S
(
A
,
C
)
S(A, C)
S
(
A
,
C
)
:
23
CS 2024 Set 1 · 2 marks · MSQ · Moderate
The symbol
→
\to
→
indicates functional dependency in the context of a relational database. Which of the following options is/are TRUE?
24
CS 2024 Set 1 · 2 marks · MSQ · Moderate
Consider the following read-write schedule
S
S
S
over three transactions
T
1
T_1
T
1
,
T
2
T_2
T
2
, and
T
3
T_3
T
3
, where the subscripts in the schedule indicate transaction IDs:
25
CS 2024 Set 2 · 1 mark · MCQ · Easy
Once the DBMS informs the user that a transaction has been successfully completed, its effect should persist even if the system crashes before all its changes are reflected on disk. This property is called
26
CS 2024 Set 2 · 1 mark · MCQ · Easy
In the context of owner and weak entity sets in the ER (Entity-Relationship) data model, which one of the following statements is TRUE?
27
CS 2024 Set 2 · 1 mark · MSQ · Easy
Which of the following file organizations is/are I/O efficient for the scan operation in DBMS?
28
CS 2024 Set 2 · 1 mark · MSQ · Moderate
Which of the following statements about the Two Phase Locking (2PL) protocol is/are TRUE?
29
CS 2024 Set 2 · 2 marks · MCQ · Moderate
The relation schema,
P
e
r
s
o
n
(
p
i
d
,
c
i
t
y
)
\mathrm{Person}(\mathrm{pid},\mathrm{city})
Person
(
pid
,
city
)
, describes the city of residence for every person uniquely identified by
p
i
d
\mathrm{pid}
pid
. The following relational algebra operators are available: selection, projection, cross product, and rename.
30
CS 2024 Set 2 · 2 marks · NAT · Moderate
A functional dependency
F
:
X
→
Y
F: X \rightarrow Y
F
:
X
→
Y
is termed as a useful functional dependency if and only if it satisfies all the following three conditions:
31
CS 2023 · 1 mark · MCQ · Easy
Which one of the options given below refers to the degree (or arity) of a relation in relational database systems?
32
CS 2023 · 2 marks · NAT · Easy
Consider the following table named Student in a relational database. The primary key of this table is rollNum.
33
CS 2023 · 2 marks · NAT · Moderate
Consider a database of fixed-length records, stored as an ordered file. The database has 25,000 records, with each record being 100 bytes, of which the primary key occupies 15 bytes. The data file is block-aligned in that each data record is fully contained within a block. The database is indexed by a primary index file, which is also stored as a block-aligned ordered file. The figure below depicts this indexing scheme.
34
CS 2022 · 1 mark · MCQ · Easy
In a relational data model, which one of the following statements is TRUE?
35
CS 2022 · 1 mark · MSQ · Moderate
Consider the following three relations in a relational database.
36
CS 2022 · 1 mark · NAT · Moderate
Consider a relation
R
(
A
,
B
,
C
,
D
,
E
)
R(A, B, C, D, E)
R
(
A
,
B
,
C
,
D
,
E
)
with the following three functional dependencies.
37
CS 2022 · 2 marks · MCQ · Moderate
Let
R
i
(
z
)
R_i(z)
R
i
(
z
)
and
W
i
(
z
)
W_i(z)
W
i
(
z
)
denote read and write operations on a data element
z
z
z
by a transaction
T
i
T_i
T
i
, respectively. Consider the schedule
S
S
S
with four transactions.
38
CS 2022 · 2 marks · NAT · Moderate
Consider the relational database with the following four schemas and their respective instances.
39
CS 2021 Set 1 · 1 mark · MSQ · Moderate
Suppose a database system crashes again while recovering from a previous crash. Assume checkpointing is not done by the database either during the transactions or during recovery.
40
CS 2021 Set 1 · 1 mark · NAT · Moderate
A relation
r
(
A
,
B
)
r(A,B)
r
(
A
,
B
)
in a relational database has
1200
1200
1200
tuples. The attribute
A
A
A
has integer values ranging from
6
6
6
to
20
20
20
, and the attribute
B
B
B
has integer values ranging from
1
1
1
to
20
20
20
. Assume that the attributes
A
A
A
and
B
B
B
are independently distributed.
41
CS 2021 Set 1 · 2 marks · MCQ · Moderate
The following relation records the age of 500 employees of a company, where
e
m
p
N
o
empNo
e
m
pN
o
(indicating the employee number) is the key:
42
CS 2021 Set 1 · 2 marks · MCQ · Moderate
Let
r
i
(
z
)
r_i(z)
r
i
(
z
)
and
w
i
(
z
)
w_i(z)
w
i
(
z
)
denote read and write operations respectively on a data item
z
z
z
by a transaction
T
i
T_i
T
i
. Consider the following two schedules.
43
CS 2021 Set 1 · 2 marks · MCQ · Moderate
Consider the relation
R
(
P
,
Q
,
S
,
T
,
X
,
Y
,
Z
,
W
)
R(P, Q, S, T, X, Y, Z, W)
R
(
P
,
Q
,
S
,
T
,
X
,
Y
,
Z
,
W
)
with the following functional dependencies.
44
CS 2021 Set 2 · 1 mark · MCQ · Easy
Consider the following statements S1 and S2 about the relational data model:
45
CS 2021 Set 2 · 1 mark · NAT · Moderate
A data file consisting of
1
,
50
,
000
1,50,000
1
,
50
,
000
student-records is stored on a hard disk with block size of
4096
4096
4096
bytes. The data file is sorted on the primary key
RollNo
. The size of a record pointer for this disk is
7
7
7
bytes. Each student-record has a candidate key attribute called
ANum
of size
12
12
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 ____ .
46
CS 2021 Set 2 · 2 marks · MCQ · Easy
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.
47
CS 2021 Set 2 · 2 marks · MCQ · Moderate
Let
S
S
S
be the following schedule of operations of three transactions
T
1
T_1
T
1
,
T
2
T_2
T
2
and
T
3
T_3
T
3
in a relational database system:
48
CS 2021 Set 2 · 2 marks · MSQ · Moderate
Suppose the following functional dependencies hold on a relation
U
U
U
with attributes
P
P
P
,
Q
Q
Q
,
R
R
R
,
S
S
S
, and
T
T
T
:
49
CS 2020 · 1 mark · MCQ · Moderate
Consider a relational database containing the following schemas.
50
CS 2020 · 1 mark · MCQ · Easy
Which one of the following is used to represent the supporting many-one relationships of a weak entity set in an entity-relationship diagram?
51
CS 2020 · 2 marks · MCQ · Easy
Consider a relational table
R
R
R
that is in 3NF, but not in BCNF. Which one of the following statements is TRUE?
52
CS 2020 · 2 marks · MCQ · Moderate
Consider a schedule of transactions
T
1
T_1
T
1
and
T
2
T_2
T
2
:
53
CS 2020 · 2 marks · NAT · Moderate
Consider a database implemented using B+ tree for file indexing and installed on a disk drive with block size of
4
K
B
4\,\mathrm{KB}
4
KB
. The size of search key is
12
b
y
t
e
s
12\,\mathrm{bytes}
12
bytes
and the size of tree/disk pointer is
8
b
y
t
e
s
8\,\mathrm{bytes}
8
bytes
. Assume that the database has one million records. Also assume that no node of the B+ tree and no records are present initially in main memory. Consider that each record fits into one disk block. The minimum number of disk accesses required to retrieve any record in the database is ____.
54
CS 2019 · 1 mark · MCQ · Moderate
Consider the following two statements about database transaction schedules:
55
CS 2019 · 1 mark · MCQ · Easy
Which one of the following statements is NOT correct about the B+ tree data structure used for creating an index of a relational database table?
56
CS 2019 · 2 marks · MCQ · Moderate
Let the set of functional dependencies
F
=
{
Q
R
→
S
,
R
→
P
,
S
→
Q
}
F = \{QR \rightarrow S, R \rightarrow P, S \rightarrow Q\}
F
=
{
QR
→
S
,
R
→
P
,
S
→
Q
}
hold on a relation schema
X
=
(
P
Q
R
S
)
X = (PQRS)
X
=
(
P
QR
S
)
.
X
X
X
is not in BCNF. Suppose
X
X
X
is decomposed into two schemas
Y
Y
Y
and
Z
Z
Z
, where
Y
=
(
P
R
)
Y = (PR)
Y
=
(
P
R
)
and
Z
=
(
Q
R
S
)
Z = (QRS)
Z
=
(
QR
S
)
.\n\nConsider the two statements given below.\n\nI. Both
Y
Y
Y
and
Z
Z
Z
are in BCNF\nII. Decomposition of
X
X
X
into
Y
Y
Y
and
Z
Z
Z
is dependency preserving and lossless\n\nWhich of the above statements is/are correct?
57
CS 2019 · 2 marks · NAT · Moderate
A relational database contains two tables Student and Performance as shown below:
58
CS 2019 · 2 marks · NAT · Moderate
Consider the following relations
P
(
X
,
Y
,
Z
)
P(X,Y,Z)
P
(
X
,
Y
,
Z
)
,
Q
(
X
,
Y
,
T
)
Q(X,Y,T)
Q
(
X
,
Y
,
T
)
and
R
(
Y
,
V
)
R(Y,V)
R
(
Y
,
V
)
.
59
CS 2015 Set 1 · 1 mark · MCQ · Easy
SELECT operation in SQL is equivalent to
60
CS 2015 Set 1 · 1 mark · MCQ · Easy
A file is organized so that the ordering of data records is the same as or close to the ordering of data entries in some index. Then that index is called
61
CS 2015 Set 1 · 2 marks · NAT · Moderate
Consider an Entity-Relationship (ER) model in which entity sets
E
1
E_1
E
1
and
E
2
E_2
E
2
are connected by an
m
:
n
m : n
m
:
n
relationship
R
12
R_{12}
R
12
.
E
1
E_1
E
1
and
E
3
E_3
E
3
are connected by a
1
:
n
1 : n
1
:
n
(
1
1
1
on the side of
E
1
E_1
E
1
and
n
n
n
on the side of
E
3
E_3
E
3
) relationship
R
13
R_{13}
R
13
.
62
CS 2015 Set 1 · 2 marks · NAT · Moderate
Consider the following relations:
63
CS 2015 Set 2 · 1 mark · MCQ · Easy
Consider the following transaction involving two bank accounts
x
x
x
and
y
y
y
.
64
CS 2015 Set 2 · 1 mark · NAT · Moderate
With reference to the B+ tree index of order
1
1
1
shown below, the minimum number of nodes (including the Root node) that must be fetched in order to satisfy the following query: "Get all records with a search key greater than or equal to
7
7
7
and less than
15
15
15
" is ____.
65
CS 2015 Set 2 · 2 marks · MCQ · Moderate
Consider a simple checkpointing protocol and the following set of operations in the log.
66
CS 2015 Set 2 · 2 marks · MCQ · Moderate
Consider two relations
R
1
(
A
,
B
)
R_1(A, B)
R
1
(
A
,
B
)
with the tuples
(
1
,
5
)
,
(
3
,
7
)
(1, 5), (3, 7)
(
1
,
5
)
,
(
3
,
7
)
and
R
2
(
A
,
C
)
=
(
1
,
7
)
,
(
4
,
9
)
R_2(A, C) = (1, 7), (4, 9)
R
2
(
A
,
C
)
=
(
1
,
7
)
,
(
4
,
9
)
. Assume that
R
(
A
,
B
,
C
)
R(A, B, C)
R
(
A
,
B
,
C
)
is the full natural outer join of
R
1
R_1
R
1
and
R
2
R_2
R
2
. Consider the following tuples of the form
(
A
,
B
,
C
)
(A, B, C)
(
A
,
B
,
C
)
:
a
=
(
1
,
5
,
n
u
l
l
)
a = (1, 5, \mathit{null})
a
=
(
1
,
5
,
null
)
,
b
=
(
1
,
n
u
l
l
,
7
)
b = (1, \mathit{null}, 7)
b
=
(
1
,
null
,
7
)
,
c
=
(
3
,
n
u
l
l
,
9
)
c = (3, \mathit{null}, 9)
c
=
(
3
,
null
,
9
)
,
d
=
(
4
,
7
,
n
u
l
l
)
d = (4, 7, \mathit{null})
d
=
(
4
,
7
,
null
)
,
e
=
(
1
,
5
,
7
)
e = (1, 5, 7)
e
=
(
1
,
5
,
7
)
,
f
=
(
3
,
7
,
n
u
l
l
)
f = (3, 7, \mathit{null})
f
=
(
3
,
7
,
null
)
,
g
=
(
4
,
n
u
l
l
,
9
)
g = (4, \mathit{null}, 9)
g
=
(
4
,
null
,
9
)
. Which one of the following statements is correct?
67
CS 2015 Set 3 · 1 mark · MCQ · Easy
Consider the relation
X
(
P
,
Q
,
R
,
S
,
T
,
U
)
X(P, Q, R, S, T, U)
X
(
P
,
Q
,
R
,
S
,
T
,
U
)
with the following set of functional dependencies
68
CS 2015 Set 3 · 1 mark · MCQ · Moderate
Consider the following relation
69
CS 2015 Set 3 · 2 marks · NAT · Easy
Consider a B+ tree in which the search key is
12
b
y
t
e
s
12\,\mathrm{bytes}
12
bytes
long, block size is
1024
b
y
t
e
s
1024\,\mathrm{bytes}
1024
bytes
, record pointer is
10
b
y
t
e
s
10\,\mathrm{bytes}
10
bytes
long and block pointer is
8
b
y
t
e
s
8\,\mathrm{bytes}
8
bytes
long. The maximum number of keys that can be accommodated in each non-leaf node of the tree is _______.
70
CS 2015 Set 3 · 2 marks · MCQ · Moderate
Consider the following partial Schedule
S
S
S
involving two transactions
T
1
T1
T
1
and
T
2
T2
T
2
. Only the
r
e
a
d
read
r
e
a
d
and the
w
r
i
t
e
write
w
r
i
t
e
operations have been shown. The
r
e
a
d
read
r
e
a
d
operation on data item
P
P
P
is denoted by
r
e
a
d
(
P
)
\mathit{read}(P)
read
(
P
)
and the
w
r
i
t
e
\mathit{write}
write
operation on data item
P
P
P
is denoted by
w
r
i
t
e
(
P
)
\mathit{write}(P)
write
(
P
)
.