Professional Documents
Culture Documents
Test 2
Test 2
Test 2
Directions for questions 1 to 35: Select the correct alterna- (C) Non-serial schedule
tive from the given choices. (D) Non-Recoverable schedule
1. If the database operations in a transaction do not update 6. In a schedule, transactions can neither read nor write
the database but only retrieve data, what is that transac- an item ‘X’ until the last transaction that wrote X has
tion called? committed or Aborted, what is that schedule?
(A) Write-only operation (B) Read-only operation (A) Cascadeless schedule (B) Strict schedule
(C) Named data item (D) Granularity (C) Recoverable schedule (D) Non serial schedule
2. Consider the 2 interleaved transactions T1 and T2: 7. Consider the given schedule
T1 T2 T1 T2
r1(x) R(x)
w1(x) x=x–N
r2(x) w(x)
r1(y) r(x)
w1(y) w(x)
r2(y) r(y)
C1
What is the number of WR conflicts present in the giv-
C2
en schedule?
Which of the following is schedule for the above? (A) 0 (B) 1
(A) r1(x), r2(x), w1(x), r1(y), w1(y), r2(y), C1, C2 (C) 2 (D) 3
(B) r1(x), w1(x), r2(x), r1(y), w1(y), r2(y), C1, C2 8. Which of the following protocol is based on locking
(C) r1(x), w1(x), r2(x), r1(y), w1(y), r2(y), C2, C1 data items to prevent concurrent transactions from
(D) r1(x), w1(x), r2(x), r1(y), r2(y), w1(y), C1, C2 interfering with one another, and enforcing an addi-
3. Two operations in a schedule are said to have conflict if tional condition that guarantees serializability?
I. They belong to different transactions. (A) 1 PL (B) 2 PL
II. They access the same data item. (C) 3 PL (D) 4 PL
III. Atleast one of the operations is write operation. 9. In Random access, for accessing a disk block on a disk,
IV. Atleast one of the operations is Read operation. what is the Rotational delay if disk rotates at 10000 rpm
Which of the following is TRUE? (rotations per minute)?
(A) I and II only (B) II and III only
(A) 6 m/sec (B) 9 m/sec
(C) I, II and III only (D) II, III and IV only
(C) 3 m/sec (D) 12 m/sec
4. A Non recoverable schedule must contain which of the
10. Whenever 2 independent 1:N relationships A:B and
following conflict?
A:C are mixed in the same relation, then which of the
(A) RR conflict (B) RW conflict
following is TRUE?
(C) WR conflict (D) WW conflict
(A) A Transitive Dependency may arise
5. Consider the given schedule: (B) A Partial Dependency may arise
T1 T2 (C) A Multi-valued Dependency may arise
r1(x) (D) None of the above
w1(x) 11. Which of the following is TRUE about 2NF?
r1(y) (A) A relation schema R is in 2 NF, if every non prime
C1 attribute A in R is not partially dependent on any
r2(x)
key of R.
(B) If the primary key contains a single attribute, the
w2(x)
test need not be applied at all.
C2
(C) Test for 2NF involves testing for functional de-
The given schedule is pendencies whose left-hand side attributes are
(A) Cascadeless schedule part of the primary key.
(B) strict schedule (D) All the above
3.118 | Database Test 2
12. Consider the following FD’s: 19. What is the time required to transfer consecutively ‘k’
X→Y non contiguous blocks that are on the same cylinder,
WY → Z where ‘S’ is seek time, ‘rd’ is rotational delay and ‘btt’
If pseudo transitive rule is applied on given FD’s, what is block transfer time?
is the result? (A) S + (k * (rd + btt)) msec
(A) X → Z (B) XW → Z (B) (S + rd + btt) msec
(C) XY → Z (D) XWY → YZ (C) S + rd + (k * btt) msec
(D) S + (k * rd) + btt msec
13. What is the average time to access a specific Record
in a file using sequential scan (Linear search) on unor- 20. What is the estimate for transferring consecutive
dered file? (Assume that there are ‘b’ blocks) blocks (include interblock gap), the disk manufacturer
(A) b/2 (B) b provides a bulk transfer rate (btr) that takes the gap size
(C) log2 b (D) 2b into account when reading consecutively stored blocks
(B), and the gap size is G bytes?
14. In which hashing technique, a type of directory, an
(A) btr = (B/(B + G)) * tr bytes/msec
array of ‘2d’ bucket addresses is maintained, where ‘d’
(B) btr = (B/(B + G)) bytes/msec
is called the global depth of the directory?
(C) btr = (B + G) + tr bytes/msec
(A) Internal Hashing (B) Extendible Hashing
(D) btr = ((B + G)/B) + tr bytes/msec
(C) Separate Chaining (D) Static Hashing
21. Match the following:
15. Assume that, a primary index is built on a file with
I. 1 NF
45 blocks, what is the number of block accesses
II. 2 NF
required to search for a specific Record in a file (Using
III. 3 NF
Binary search)?
P. No Non key attribute should be functionally de-
(A) 45 (B) 23
pendent on a part of the primary key.
(C) 6 (D) 7
Q. Relation should have no nonatomic attributes or
16. Consider the given 2 schedules: nested relations.
Sa: r1(x), w1(x), r2(x), w1(x), w2(x), r1(y), C1, C2 R. Relation should not have a non key attribute func-
Sb: r1(x), w1(x), r2(x), w2(x), r1(x), C1, C2 tionally determined by another non key attribute.
Which of the following is TRUE? (A) I–P, II–Q, III–R
(A) Both are conflict serializable (B) I–Q, II–P, III–R
(B) Only Sa is conflict serializable (C) I–Q, II–R, III–P
(C) Only Sb is conflict serializable (D) I–R, II–Q, III–R
(D) Both are not conflict serializable
22. Consider the given Relation EMP and given functional
17. Consider the given transaction T1, that follows 2-phase dependencies:
Locking protocol: F = (E → N
T1
P → A, L
E P → H)
1. Read – Lock(X)
Which of the following is Incorrect closure set with re-
2. Read – item (X) spect to F?
3. Write – Lock(Y) (A) E+ = {E, N}
4. Unlock(X) (B) P+ = {P, A, L}
5. Read – item(Y) (C) {EP}+ = {E, N, P, A, L, H}
6. Y = X + Y (D) {EH}+ = {E, N, H, P, A}
7. Write – item(Y) 23. Consider the functional dependencies given in the
8. Unlock(Y) above question, EMP Relation is in which Normal
Form?
Which of the following is TRUE? (A) 1 NF (B) 2 NF
(A) Record 1 to Record 3 is Growing phase (C) 3 NF (D) BCNF
(B) Record 4 to Record 8 is shrinking phase
24. Consider the given 2 tables:
(C) Record 1 to Record 4 is Expanding phase
Person
(D) Both (A) and (B)
18. Consider a disk with track size 70 Kbytes and it rotates Name Mobile
at 3600 rpm, what is the transfer rate in bytes/m sec? Anil 9848463
(A) 3500 (B) 3600 9440072
(C) 4200 (D) 4500 Raj 9004432
Database Test 2 | 3.119
Answer Keys
1. B 2. B 3. C 4. B 5. A 6. B 7. B 8. B 9. C 10. C
11. D 12. B 13. A 14. B 15. D 16. D 17. D 18. C 19. A 20. A
21. B 22. D 23. A 24. B 25. B 26. C 27. C 28. B 29. C 30. B
31. C 32. A 33. A 34. C 35. A
WR Precedence Graph:
WW
∴ One WR conflict is present. Choice (B) T1 T2
20. Transferring consecutive blocks (including inter block x ----------------- 30000 records
gap)
x =
30000
⇒ btr = (B/(B + G)) * tr bytes/msec = 937.5 = 938 blocks Choice (C)
Choice (A) 32
21. I – Q, II – P, III – R is correct match. Choice (B)
+ 30. Order P = 3
22. {EH} cannot determine P and A. Choice (D)
23. The key for EMP is {EP} and the functional 6 4 6 5 5
Dependencies. E→N
P → A, L are partial dependencies. 5
6 9
4
∴ EMP is not in 2NF i.e., it is in 1 NF. Choice (A) 4 6
7
24. Both tables are not in 1 NF, person table has multiple
5 7
values under mobile column for one name, In student 5 7
relation, there is another relation project, A relation
within a Relation is not allowed in 1 NF. Choice (B) 4 6
9 2 4 6
25. It is Dependency preserving, A → BE is in R1 and C → D 9
is in R2.
Checking for loss less join: ∴ 2 Node splits Choice (B)
31. Cylinders = Number of tracks that is 400 Choice (C)
A B C D E
32. S1: r1(P), r2(R), r1(R), r3(P), r3(Q), W1(P), C1,
R1(ABE) * * *
w3(Q), C3, r2(Q), w2(R), w2(Q), C2
R2(CD) * *
It is Not Loss Less JOIN. Choice (B) To check recoverability, search for RW conflict. There
is one RW conflict, T3 is performing write operation so
26. A → C
it has to commit first.
BCD → E
∴ S1 is Recoverable.
DE → B
S2: r1(P), r2(R), r1(R), r3(P), r3(Q), w1(P),
L M R w3(Q), r2(Q), w2(R), w2(Q), C1, C2, C3.
AD BCE
T3 has to commit first but T2 has committed first.
∴ S2 is not a recoverable schedule. Choice (A)
{AD}+ = {ADC}
33. S1:
ADB+ = {ADBCE}
ADC+ = {ADC} T1 T2 T3
ADE+ = {ADECB} Choice (C) r1(P)
27. Candidate keys are: ADB, ADE r2(R)
Prime Attributes are part of any candidate key, ABDE r1(R)
Choice (C) r3(P)
28. Blocking factor is defined as, the number of records r3(Q)
stored on one block. w1(P)
1024 210 C1
Bfr = = 5
= 2 = 32 Records
32 25 w3(Q)
Choice (B) C3
r2(Q)
29. Blocking Factor
w2(R)
2048 211
= = 5
= 2 = 32 records/block
w2(Q)
64 26 C2