809purl Databases TYS-2026
809purl Databases TYS-2026
Workbook 2026
Detailed Explanations of
Try Yourself Questions
© Copyright: Subject matter to MADE EASY Publications, New Delhi. No part of this book may be reproduced or utilised in any form without the written permission.
1 Introduction to DBMS and Integrity
Constraints and ER Model
T1 : Solution
Employee Pno
Policyno Email
Policyno., Email and Pno. are multivalued attributes i.e. each employee may have one or more set of
these values.
Hence multivalued attributes are combined with key to make separate tables.
R1 (Eid, Ename, Age, Eid, Pno., Policyno., Email)
Therefore, 1 table is required.
( ii)) For BCNF the functional dependencies should be such that left side of FD is key.
R1 (Eid, Ename, Age)
R2 (Eid, Pno., Policyno., Email)
Eid uniquely determines Ename and Age in R1
In R2 there is no redundancy due to functional dependency so it is in BCNF (redundancy due to
multivalued functional dependency allowed).
( iii)) R1 (Eid, Ename, Age)
R2 (Eid, Pno.)
R3 (Eid, Policyno.)
R4 (Eid, Email)
There are no multivalued dependencies, so all four tables are also in 4NF.
Hence 4 tables are sufficient.
www.madeeasypublications.org © Copyright
Detailed Explanations of Try Yourself Questions : GATE 2026 3
T2 : Solution
(c)
R (A, B, C, D, E)
The given FD’s are ABC → DE and D → AB because C → C is a trivial FD so DC → ABC will also be a FD.
∴ DC will be a candidate key and ABC is another candidate key.
The following are the super key’s possible listed below.
1. ABCDE 2. ABCD
3. ABC 4. ABCE
5. DC 6. DCA
7. DCB 8. DCAE
9. DCE 10. DCB
∴ 10 super key’s are possible.
T3 : Solution
(c)
As per definition of DML (Data Manipulation Language), it is used for selecting, inserting, deleting and
updating data in database.
Hence option (c) is true.
T4 : Solution
(c)
Inserting tuples, deleting tuples is work of DML i.e. (Data Manipulation Language).
T5 : Solution
(a)
Views in a database system are important because of the following reasons:
(i) They help provide data independence.
(ii) They help with access control by allowing users to see only a particular subset of the data is database.
T6 : Solution
© Copyright www.madeeasypublications.org
4 Computer Science & IT • Databases
T7 : Solution
(b)
Journal (Volume, Number, Startpage, Endpage, Title, Year, Price)
Primar
Primaryy key: Volume, Number, Startpage, Endpage
FD’s: Volume Number Startpage Endpage → Title
FD’s:
Volume number → Year
Volume Number, Startpage Endpage → Price
Given relation 1NF but not 2NF. This DB is redesigned following schemas
R1(Volume, Number Startpage Endpage Title Price) which has FD’s
Volume Number, Startpage Endpage → Title
Volume Number Startpage Endpage → Price
Which is in BCNF.
R2(Volume, Number, Year)
Volume Number → Year
Which is also in BCNF.
Journal in 1NF
R1 R2 in BCNF
Weakest NF which satisfy R1 and R2 and fails for journal is 2NF.
T8 : Solution
(b)
As R is referring to R2 and S is primary key of R2, πR(r1) – πS(r2) will give empty relation or empty table as
number of values in R column of table r1 will always refer to of respective values in S column of r2.
T9 : Solution
(4)
Minimum number of tables required are 4.
1. Bank {Code, Ph No, Name, Addr} where code, Ph_No. is primary key.
2. Branches {Branch No, Code} where branch number or code is the primary key.
3. Bank_Branch {Addr, Branch_No, Bank_Name}
4. Loan Taken {Loan_No, Amount, Type, Branch_No.} where Loan No as the primary key.
Here we can not merge Branches relation and Bank Branch entity because foreign key “code” is not the
candidate key of Bank entity. So, we can not combined these two.
T10 : Solution
(5)
The RDBMS tables that are need to be drawn will be:
(i) E3 R2 which have ‘A’ as its candidate key.
(ii) E2 R4 which have ‘D’ as its candidate key.
(iii) E1 R3 which have ‘D’ as its candidate key.
www.madeeasypublications.org © Copyright
Detailed Explanations of Try Yourself Questions : GATE 2026 5
T11 : Solution
(50)
For relationship set R candidate and E1 candidate key is same because between E1 to E3, E1 to E2 and E1
to E4 there is one to many relationship.
T12 : Solution
(5)
(AC ) (A B) (A D ) (D E ) DF
A→B D →E
T13 : Solution
(2)
Because of partial participation E1 must separate, E2 R can merge
E1(ABC) E2R(ADEF )
A → BC D → EF
D→A
T14 : Solution
(b)
A B C K L
1
1 1
E1 R4 E4
M 1
3
2
R1 R5 4
D E H I J
N 1
1 1
E2 R3 E3 R6 E5
1 M
M N
R2 5 F G
© Copyright www.madeeasypublications.org
2 Normalization
T1 : Solution
www.madeeasypublications.org © Copyright
Detailed Explanations of Try Yourself Questions : GATE 2026 7
T2 : Solution
© Copyright www.madeeasypublications.org
8 Computer Science & IT • Databases
T4 : Solution
(56)
A+ = {A B C D E F}
B+ = {A B C D E F}
D+ = {A B C D E F}
Clearly, there are three candidate keys.
Thus, N(A ∪ B ∪ D) = N(A) + N(B) + N(D) – {N(A ∩ B) + N(B ∩ D) + N(A ∩ D) + N (A ∩ B ∩ D)}
Where, N(A ∩ B ∩ D) represents number of super keys where A or B or D is candidate keys.
⇒ N(A ∪ B ∪ D) = 3 × 25 – 3 × 24 + 23
= 96 – 48 + 8 = 56
T5 : Solution
(d)
1 2 3 4 5
www.madeeasypublications.org © Copyright
3 Queries
T3 : Solution
Select Student
From FREQUENTS
Where parlor in (select parlor from SERVES where ice-cream in (select ice-cream from LIKES where
LIKES.student = FREQEUNTS.student))
T4 : Solution
(b)
(a) finds those drinkers who are frequents atleast one bar on same city where he lives.
T5 : Solution
(d)
(a) πA1(R1 – R2) ≡/ πA1(R1) – πA1(R2) because
R1 A1 A2 R2 A1 A2
2 4 2 4
3 4 2 5
2 5 3 5
3 5
© Copyright www.madeeasypublications.org
10 Computer Science & IT • Databases
T6 : Solution
(d)
Course_id Course_id Course_id
CS-101 CS-101 CS-347
– =
CS-347 CS-315 PHY-101
PHY-101 CS-311
FIN-201
HIS-351
MU-199
T7 : Solution
(a)
Query I returns vertices whose out degree is only 2. But Query II returns whose out degree is atleast 2.
T8 : Solution
(d)
1. ρ(R1, πsid (πcid (σ (Course)) Enrols))
branch = ‘CS’
ρ(R2, πsid (πcid (σ (Course)) Enrols))
branch = ‘IT’
R1 ∩ R2
Find the Sid who enrolled atleast one course of CS branch then find the Sid who enrolled atleast one course
of IT branch. Then take inter-section both Sid.
2. {T∃T1 ∈ enrols (∃x∈ courses (x.branch = ‘CS’ ∧ x.cid = T1.cid) ∧ ∃T2 ∈ Enrols (∃y∈ courses (y.branch
= ‘IT’ ∧ y.cid = T2.cid) ∧ T2.sid = T1.sid) ∧ T.sid = T1.sid)}
Find the Sid who enrolled atleast one course of CS branch then find the Sid who enrolled atleast one course
of IT branch with same Sid. Then return Sid.
3. Select Sid
From courses P, Enrols C
where P.branch=‘CS’ AND P.cid = C.cid AND EXISTS (Select Sid
From courses P2, Enrol C2
where P2.branch = ‘IT’ AND C2.sid = C.sid
AND P2.cid = C2.cid)
Find the Sid who enrolled atleast one course of CS branch then find the same Sid enrolled for atleast one
course of IT branch and return it.
www.madeeasypublications.org © Copyright
4 File Structure and Indexing
T2 : Solution
10000
∴ Number of index blocks =
Block factor of index block
1024
Block factor of index block = = 64
(9 + 7)
10000
∴ Number of index 1st level blocks = = 157 blocks
64
10000
∴ Number of blocks in file =
Block factor in file
1024 1024
Block factor = = = 11 records/block
100 100
10000
∴ Number of blocks = = 910 blocks.
11
910
Number of index blocks = = 14.21 = 15
64
© Copyright www.madeeasypublications.org
12 Computer Science & IT • Databases
T3 : Solution
1024
Index block factor = = 69
15
30000
Number of 1st level index blocks = = 435 blocks
69
435
Number of 2nd level index blocks = = 70 blocks
64
Number of 3rd level index blocks = 1 (7 entries only to be entries in index block).
(b) Number of entries in 1st level secondary index = Number of blocks in file
30000
Number of blocks in file =
Block factor of block
1024
Block factor = = 11
100
30000
Number of blocks in file = = 2728 blocks
11
2728 2728
Number of blocks in 1st level = = = 39.5 = 40
Block factor of index block 69
Number of blocks in 2nd level = 1 (only 40 entries per index block and block factor is 69)
(c) 3 levels.
(d) 2 levels.
www.madeeasypublications.org © Copyright
Detailed Explanations of Try Yourself Questions : GATE 2026 13
T4 : Solution
1250
Number of index blocks in 1st level = = 125 blocks
10
125
Number of index blocks in 2nd level = = 12 blocks
11
12
Number of index blocks in 3rd level = = 2 block needed.
11
Number of index blocks in 4th level = Only 1 block needed.
∴ By using Dense index minimum 140 index blocks and 4 index levels are required.
1250
Number of index blocks in 1st level = = 250 blocks
5
250
Number of index blocks in 2nd level = = 42 blocks
6
42
Number of index blocks in 3rd level = = 7 block needed.
6
7
Number of index blocks in 4th level = = 2 blocks
6
Number of index blocks in 5th level = Only 1 block needed.
∴ Using Dense index maximum 302 index blocks and 5 index levels are required.
1250
Number of blocks in file = = 417 blocks
3
417
Minimum number of index blocks at 1st level = = 42 (leaf level)
10
42
Minimum number of index blocks at 2nd level = =4
11
Minimum number of index blocks at 3rd level = Only 1 block is needed and minimum 3 levels are
required.
© Copyright www.madeeasypublications.org
14 Computer Science & IT • Databases
417
Number of index blocks in 1st index file = = 84 (leaf levels)
5
84
Number of index blocks in 2nd index file = = 14
6
14
Number of index blocks in 3rd index file = =3
6
Number of index blocks in 4th index file = 1 block
∴ Using sparse index 102 blocks and 4 levels.
T5 : Solution
(a)
B+ tree records are stored in primary order. B+ tree does not use hashing because it’s not possible to
answer range queries using hashing.
Updations do not cause unbalance in the tree.
T6 : Solution
(c)
The maximum number of new nodes created is “number of levels +1”.
In the given case the number of levels are four (including root).
Hence maximum number of new nodes (created are 5)
T7 : Solution
(b)
A data dictionary contains a list of all files in this database, the number of records in each file, and the
names and types of each field.
Data database, only book-keeping information for managing it.
T8 : Solution
(a)
B+ tree balanced because the length of the paths from the root to all leaf nodes are all equal and every
internal node must filled by.
www.madeeasypublications.org © Copyright
5 Transaction and
Concurrency Control
T1 : Solution
For the schedule to be view serializable it must satisfy the following conditions: (1) Final Write (2) Initial
Read and (3) WR Sequence.
Final Write
For data item A : No write operations.
For data item B : T1, T2, T3 (order of WRITE operation on data item B)
should execute
Therefore [T1, T2 ] →T3
before T3
Initial Read
No write operation on A as well as no read operation on B. Hence this condition do not specify an y order
of execution.
WR Sequence
No such sequence. Therefore no condition on order of execution.
∴ The following are the view equivalent schedules.
T1 → T2 → T3
T2 → T1 → T3
© Copyright www.madeeasypublications.org
16 Computer Science & IT • Databases
S3 : r 1(A), r 3(D), w1(B), r 2(B), w3(B), r 4(B), w2(C), r 5(C) w 4(E), r 5(E), w5(B)
Final write:
A : No WRITE operation
B : T1 T3 T5 i.e. [T 1, T 3] → T5
C : T2
D : No write operation on D
Initial Read:
A : Only T1 reads, but no update
B : No initial read operation
C : No initial read operation
D : Only T3 reads but no update operation
E: No initial read
∴ No condition on order of execution.
WR Sequence:
A : No updation on A
B : T1 → T2
T2 → T3
T3 → T4
C : T2 → T5
D : No updation D
E: T4 → T5
∴ Therefore only one serial schedule is view equivalent.
T1 → T2 → T3 → T4 → T5
S5 : r 2(A), r 1(A), w1(C), r 3(C), w1(B), r 4(B), w 3(A), r 4(C), w2(D), r 2(B), w4(A), w4(B)
WR Sequence
B: T1 → T4 , T1 → T2
C: T1 → T3
Final Write
A: T3 , T4 i.e. T3 → T4 (T3 followed by T4)
B: T1 , T4 i.e. T1 → T4
Initial Read
A: T1, T2 reads it initially and later updated by T3 and T4.
∴ (T1 , T2) → (T3 , T4)
B: No initial reads
C: No initial reads
D: No initial reads
∴ Based on the all the above conditions there’s only one serial schedule which is view equivalent
i.e. T1 → T2 → T3 → T4
www.madeeasypublications.org © Copyright
Detailed Explanations of Try Yourself Questions : GATE 2026 17
T2 : Solution
S1 : T1 T2 T3 S2 : T1 T2 T3
r(x) r(x)
r(z) r(z)
w(x) r(z)
r(x) r(x)
r(y ) r(y)
w(x) Strict recoverable w(x) Not strict recoverable
Cascadeless Irrecoverable
C1 Recoverable C Casscodeless
w(y) w(y)
C3 r(y)
r(y) w(z)
w(z) w(y)
w(y) C1
C2 C2 C2
S3 : T1 T2 T3
r(x)
r(z )
r(x)
r(z)
r(y )
r(y)
No strict
w(x) Recoverable
C1 Cascadless
w(z)
w(y)
w(y)
C C3
C2
T3 : Solution
(1)
No conflict serializable T1 T2
r(x)
Not recoverable concept here
r(x) T1 T2
View serializable T1 → T2
w(x)
No cascade abort w(x)
No cascade abort
Not strict recoverable
(2)
Conflict serializable T1 T2
w(x)
View serializable T1 → T2
r(y) T1 T2
Not recoverable concept
r(y)
Not strict recoverable r(x)
Not cascade abort
Serializable
© Copyright www.madeeasypublications.org
18 Computer Science & IT • Databases
(3)
Conflict serializable T1 T2 T3
Not recoverable r(x)
r(y)
Not strict T1 T2
w(x)
No cascadeless r(x)
Conflict serializable T1 T3 T2 r(y) T3
View serializable
T3 → T2T1
T1T3 → T2
T3 ⋅ T1 → T2
(4)
No conflict serializable T1 T2 T3
Not conflict T1 T2
r(x)
View serializable not possible
w(x)
T2 → T1 but T1 come first since initial read w(x)
T1 T2
Recoverable abort
Not strict recoverable commit
Not cascadeless
Not serializable
(6)
Not conflict T1 T2
w(x)
View serializable T1 → T2
r(x)
Recoverable
w(x) T1 T2
Not strict r(x)
Cascadeless C1
Serializable
www.madeeasypublications.org © Copyright
Detailed Explanations of Try Yourself Questions : GATE 2026 19
(8)
Not conflict T1 T2
w(x)
Not view serializable
r(x)
Not recoverable w(x) T1 T2
Not cascadeless C2
C1
Not serializable
Not strict
T4 : Solution
(a) T1 T2 T3
r(a)
r(b)
r(c )
w(b)
w(c)
w(d)
T3
(iii) T1 T2 T3
s(a)
r(a)
s(b)
s(c) cannot
r(b) get X(c)
unlock (B)
s(c)
X(d)
r(c)
unlock (c)
X(b)
w(b)
unlock (b)
unlock (a) No allowed because
X(c ) T2 is in shrinking
w(c)
w(d) phase
© Copyright www.madeeasypublications.org
20 Computer Science & IT • Databases
T1 T2 T3
r(a)
r(b)
r(c )
w(b)
w(c)
w(a)
T1 T2
T3
Since, there is a cycle in the precedence graph, hence the schedule is not conflict serializable.
(ii) View serializable
For A → T1 → T3
For B → T2 → T1
For C → T3 → T2
Hence, none of the schedule can lead to a view serializable schedule.
(iii) Basic 2PL
T1 T2 T3
S(a )
r(a) S(b)
r(b)
S(c)
r(c )
w(b)
w(c)
w(a)
www.madeeasypublications.org © Copyright
Detailed Explanations of Try Yourself Questions : GATE 2026 21
(c) r 1(A), r 2(B), r 3(C), r 1(b ), r 2(C), r 3(d ), w 1(C), w 2(D), w 3(E)
(i ) Conflict serializable
T1 T2 T3
r (A )
r(B)
r(C)
T1 T2
r( b )
r( c )
r( d ) T3
w(c)
w(d)
w(e )
∴ Conflict serializable.
Order ⇒ T3 → T2 → T1
(ii) View serializable: T3 → T 2 → T 1
∴ Because, on data item ‘C’ initial read is by T3 and final write is by T1. Hence, T3 should be followed by T1.
∴ Because, on data item ‘d ’ initial read is by T3 and final write is by T2.
Hence T3 should be followed by T2.
(iii) Basic 2PL
T1 T2 T3
S(a),S( b)
r(a)
S(b),S(c)
r(b)
S(c), S(d), X(e)
r(c)
r(b)
r(c)
Not
allowed r(d)
X(c)
w(c)
w(d)
w(e)
© Copyright www.madeeasypublications.org
22 Computer Science & IT • Databases
T1 T2 T3
S(a),S(b)
r(a)
unlock (a) S(b ),S(c)
r(b)
unlock (b)
S(b),S(d)
r(c)
unlock (c)
r(b)
unlock (b)
r(c)
unlock (c)
r(d)
unlock (d)
X(c)
w(c)
unlock (c)
w(d)
X(d)
unlock (d)
w(e)
X(e)
unlock (e)
(d) r 1(A), r 2(B), r 3(C), r 1(B), r 2(C), r 3(D), w1(A), w2(A), w 3(C)
(i) Conflict serializable
T1 T2 T3
r(a )
r(b)
r(c )
T1 T2
r(b )
r(c)
T3
r(d)
w(a)
w(a)
w(c)
∴ Schedule is conflict-serializable.
(ii) View serializable
Hence only for data item ‘a’, initial read is done by T1 and final write is done by T2. Hence T1 should be
followed by T2.
For any other data item, there is no such dependency. Hence, the schedule possible under view serializable
are: T3, T1, T2, T1, T3, T2, T1, T2, T3
www.madeeasypublications.org © Copyright
Detailed Explanations of Try Yourself Questions : GATE 2026 23
T1 T2 T3
X(a)
r(a)
S(b)
r(b)
S(c),S(d)
r(c)
unlock (c)
S(b)
r(b)
unlock (b)
S(c)
r(c)
unlock (c)
r(d)
unlock (d)
w(a)
unlock (b)
X(a)
w(a)
unlock (a)
X(c)
w(c)
unlock (c)
T1 T2 T3
r(a)
S(b ),S(c)
r(b)
S(c),S(d)
r(c)
r(b)
r(c)
r(d)
w(a)
unlock (b)
unlock (a)
X(a)
w(a)
unlock (a)
unlock (b)
unlock (c)
X(c)
w(c)
unlock (c)
unlock (d)
© Copyright www.madeeasypublications.org
24 Computer Science & IT • Databases
(e) r 1(A), r 2(B), r 3(C), r 1(B), r 2(c), r 3(A), w 1(A), w2(B), w 3(C)
(i) Conflict serial schedule
T1 T2 T3
r(a )
r(b)
r(c)
T1 T2
r(b )
r(c)
T3
r(a )
w(a)
w(b )
w(c)
∴ Conflict serializable schedule: T3, T1, T2, T1, T3, T2, T1, T2, T3
(ii) View serializable
Since the schedule is conflict serializable hence view serializable two.
(iii) Basic 2PL
T1 T2 T3
X(a),s(b)
r(a)
S(b),s(c)
r(b)
s(c)
not possible
r(c)
r(b)
r(c)
s(a)
r(a)
w(a)
w(b)
w(c)
T1 T2 T3
s(a),s(b)
r(a)
s(b),s(c)
r(b)
s(c)
r(c)
r(b)
unlock (b)
r(c)
unlock (c)
s(a)
r(a)
unlock (a)
X(a)
w(a)
unlock (a)
X(b)
w(b)
unlock (b)
X(c)
w(c)
unlock (c)
www.madeeasypublications.org © Copyright
Detailed Explanations of Try Yourself Questions : GATE 2026 25
T5 : Solution
(c)
Concurrency control ensures isolation of the transactions.
Recovery management is responsible for Atomicity. Application manager (user) ensures consistency.
T6 : Solution
(c)
Ensuring consistency for an individual transaction is the responsibility of application programmer.
T7 : Solution
(b)
Every view serializable is not conflict serializable i.e., when schedule is view serializable and there is a
write-write conflict then it is not conflict serializable.
T12 : Solution
(c)
No uncommitted reads so that its casecadeless rollback recoverable because T1w1(x) before T1 commit /
Rollback T2w2(x).
So not strict recoverable.
T1 T2
r2(x)
r1(x)
r2(y)
w1(x)
r1(y)
w2(x)
a1
a2
© Copyright www.madeeasypublications.org