Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
Management Systems
(Solutions for Text Book Practice Questions)
ACE Engineering Publications Hyderabad • Delhi • Bhopal • Pune • Bhubaneswar • Lucknow • Patna • Bengaluru • Chennai • Vijayawada • Vizag • Tirupati • Kolkata • Ahmedabad
2 DBMS
ACE Engineering Publications Hyderabad • Delhi • Bhopal • Pune • Bhubaneswar • Lucknow • Patna • Bengaluru • Chennai • Vijayawada • Vizag • Tirupati • Kolkata • Ahmedabad
3 CSIT‐Postal Coaching Solutions
21. Ans: (b) primary key of P side (i.e P1) as foreign key.
Sol: Strong entities E1 and E2 are converted as N is weak entity, so modify N to
separate tables. Since A23 is a multi valued accommodate primary key of P (i.e P1) as
attribute it should also be converted as foreign key.
separate table. Relationship R is transferred Therefore tables are (M1, M2, M3, P1),
to ‘m’ side (E2). (P1, P2), (N1, N2, P1). So correct answer is
(M1, M2, M3, P1).
22. Ans: 3
Sol: E-R model is 26. Ans: (b)
Sol:
Employee manages Department sponsors Project
An Entity type is represented with one
relation.
The minimum number of relations in Key attribute becomes primary key for the
relational model is 3. relation
1. (Employee, manages) Composite attribute is represented with set of
2. Department simple attributes
3. (Project, sponsors) Weak entity is represented always as a child
table
23. Ans: (c)
Sol: From both Employee and Department we 3. Functional Dependencies
have total participation and key constraint
possible, Which can be converted into one
01. Ans: (d)
relation in relational model.
Sol: As ‘BC’ is key BC→A is satisfied
be trivial iff Y X. A → B AC → BC
AC → D
07. Ans: (b) And remaining FD’s are not possible to
Sol: CD + from functional dependencies eliminate
(FDs) = CDEAB, it includes RHS attributes 5 FD’s are there in minimal cover.
AC so it can be derived from FDs BD+ from
functional dependencies 13. Ans: (b)
(FDs) = BD only, RHS attributes CD are not Sol: As with C we determine B using the
included in the closure hence it cannot be dependencies C E and C B, then
derived BC + from functional dependencies
attribute B can be dropped from X.
(FDs) = BCDEA, it includes RHS attributes
CD, so it can be derived from FDs AC+ from
14. Ans: (d)
functional dependencies
Sol: BC→A is inessential as it can be determined
(FDs) = ACBDE, it includes RHS attributes
from the remaining set of dependencies.
BC so it can be derived from FDs
ACE Engineering Publications Hyderabad • Delhi • Bhopal • Pune • Bhubaneswar • Lucknow • Patna • Bengaluru • Chennai • Vijayawada • Vizag • Tirupati • Kolkata • Ahmedabad
5 CSIT‐Postal Coaching Solutions
26. Ans: 6
20. Ans: (b)
Sol: AB, AD, EB, ED, CB, CD.
Sol: As ‘K’ is independent attribute, key is
ABDK.
27. Ans: 2
Sol: D, AH
21. Ans: (d)
Sol: ABD+ = A, B, C, D, E.
28. Ans: (c)
Sol: A candidate key always determines any attribute
22. Ans: (b) of a relation. A superset of a candidate key is
Sol: ACEH+ contains all the attributes of R. called super key and it can determine all the
attributes of a relation
ACE Engineering Publications Hyderabad • Delhi • Bhopal • Pune • Bhubaneswar • Lucknow • Patna • Bengaluru • Chennai • Vijayawada • Vizag • Tirupati • Kolkata • Ahmedabad
6 DBMS
ACE Engineering Publications Hyderabad • Delhi • Bhopal • Pune • Bhubaneswar • Lucknow • Patna • Bengaluru • Chennai • Vijayawada • Vizag • Tirupati • Kolkata • Ahmedabad
7 CSIT‐Postal Coaching Solutions
is XX
07. Ans: (c) ( P R )
P .Y R .Y R .V V 2
Sol: ‘A’ is a column in relation R, then instead of X
2
ACE Engineering Publications Hyderabad • Delhi • Bhopal • Pune • Bhubaneswar • Lucknow • Patna • Bengaluru • Chennai • Vijayawada • Vizag • Tirupati • Kolkata • Ahmedabad
12 DBMS
TRUE for every value that the sub query produces salaries for department 5, > Any
returns. If the sub query returns no value, the operator Perfectly produces the desired
condition is TRUE. results.
23. Ans: 7
Sol: The output of the query is ta.player 7. Transactions & Concurrency Control
Klose
Ronaldo
G muller
Fontaine 01. Ans: (d)
Pele Sol: A: Atomicity C: Consistency
Klismann
I: Isolation D: Durability
Kocsis
T1 S4:
T2 S3: T1
T1 T2
T3
For a schedule, whose precedence graph
S1 is conflict serializable to T2T3T1
contains cycles are said to be not conflict
serializable.
T1 T2 T3
R(A) 17. Ans: (d)
W(A)
Sol: S1 and S2 are conflict equivalent to serial
R(A) schedule T2, T3, T1.
W(A) S3 is not conflict equivalent as 2RA, 3WA
W(A) (T2<T3) and 3WA, 2WA (T3<T2) are the
conflict operations. There is no serial
ACE Engineering Publications Hyderabad • Delhi • Bhopal • Pune • Bhubaneswar • Lucknow • Patna • Bengaluru • Chennai • Vijayawada • Vizag • Tirupati • Kolkata • Ahmedabad
16 DBMS
schedule that satisfies both T2<T3 and transaction to release the lock where as an
T3<T2. younger transaction aborts if requesting a
lock held by an older one.
18. Ans: (c) In wound-wait deadlock prevention strategy
Sol: Precedence graph is an younger transactions need to wait for an
T1
older transaction to release the lock but an
T2
older transition requesting a lock held by an
T3 younger one preempts younger transaction
to abort.
19. Ans: (d)
Sol: Let Ti, Tj and Tk are three transactions, if we 24. Ans: (a)
assume blind write of Tk is the last write Sol: In the wait for graph we find a cycle from
operation, then blind writes of other two T31 – T30 – T29 – T31 results in a
transactions appear in two ways i.e deadlock.
Ti–Tj–Tk or
Tj–Ti–Tk 25. Ans: (b)
Sol: 2 PL is based on locks and hence not free
from deadlock but ensures conflict
20. Ans : (c)
serializability. Timestamp ordering protocol
Sol: To perform W(y) T2 acquires Exclusive lock
is based on timestamps ensures conflict
on y, which will be released only after
serializability and also free from deadlock.
commit in strict 2pl. Then request for T1 is
processed only after commit of T2,.
8. Indexing
21. Ans: (c)
Sol: In strict 2 PL, all excusive locks (write
locks) must be released after commit 01. Ans: (a)
statements. Hence Option (c) is correct. Sol: Cluster index is created on a column with
cluster of values (like year, age, branch
22. Ans: (c) where group of students fall under one
group), so it is non-key but requires
Sol: An older transaction requesting a data item
ordering.
held by an younger Tx need to wait.
In primary index, the number of index All the key values in each node are kept in
records= 400 which is number of blocks in sorted order.
multi level index.
08. Ans: 52
03. Ans: (c) Sol: Key =8 Block size = 512,
Sol: Since block size is 210 (=1024 bytes), Block pointer = 2 bytes, the order of B+ tree
2m 2n = 210. Only option (c) satisfies with is maximum number of block pointers in it.
m = 8 and n = 2. (Let ‘n’)
n * 2 + (n – 1) 8 512
04. Ans: (c)
2n + 8n – 8 512
Sol: n*5+(n–1)*(10+8) 512
10n 520
5n+16n–18 512
n 52
23n 530
n 23. 09. Ans: (b)
Sol: n P + (n-1)k <=B. Where n is order of the
05. Ans: (a)
tree, P is block pointer, k is key value and B
Sol: Insertion of new key is leading to insertion
is block size.
of new node at all 4 levels, in turn it is
leading to insertion of new root node. Hence Therefore n 6 + (n – 1)9 <=1024.
the maximum number of nodes that could be n = 1033/16 = 64 (approximately)
created are 5
10. Ans: 50
06. Ans: 5 Sol: Order of non-leaf node is
Sol: The nodes to access all records with a (n8) + (n–1) 12 1024
“search key greater than or equal to 7 and 8n + 12n – 12 1024
less than 15” is (9), (5), (5, 7) (9, 11) and 20n 1036
(13, 15). n 51
maximum number of keys possible is :50
07. Ans: (b)
Sol: • B+ Tree is a height balanced search tree 11. Ans: (b)
non leaf nodes have pointers to the next Sol: order of leaf node is n(9+7)+6<=512
16n<=506
level nodes but not to the data records
n <=31
All the leaf nodes are connected with a
order of internal node is n*6+(n-1)*9<=512
pointer Pnext. 15n<=521
N<=34
ACE Engineering Publications Hyderabad • Delhi • Bhopal • Pune • Bhubaneswar • Lucknow • Patna • Bengaluru • Chennai • Vijayawada • Vizag • Tirupati • Kolkata • Ahmedabad
18 DBMS
31 entries
15 30 50
15 30
40 45
30 40 45 50 10 15 20 25 30 40
10 15 20 25 30 40
14. Ans: (d)
Sol: Deleting ‘10’ from internal node requires 10
to be replaced with copy of 13. Hence Root now consists: 20
(i) is true, (ii) is true but (iii) is not true
15. Ans: (a)
Sol: Insert 15
40
15 30 50
10 15 20 30 40 50
ACE Engineering Publications Hyderabad • Delhi • Bhopal • Pune • Bhubaneswar • Lucknow • Patna • Bengaluru • Chennai • Vijayawada • Vizag • Tirupati • Kolkata • Ahmedabad