Week-8 Assignment8 DBMS
Week-8 Assignment8 DBMS
Week-8 Assignment8 DBMS
Total Marks : 20
Question 1
Identify the options which are true for Immediate-modification scheme. Marks:2 MSQ
a) Allows updates of an uncommitted transaction to be made to the buffer, or the disk itself,
before the transaction commits.
c) Output of updated blocks to disk storage can take place at any time before or after trans-
action commit.
Answer: a), c)
Explanation:
Refer Module 36 slide 20
1
Question 2
Consider the following state of transactions:
1. T1 can be ignored.
2. T2 and T3 redone
3. T4 undone
4. T4 redone
Mark the correct group of statements from the options below. Marks:2 MCQ
a) 1), 2), 4)
b) 1), 2), 3)
Answer: b)
Explanation: Refer slide 30 in Module 36. Any transactions that committed before the last
checkpoint should be ignored. Therefore, T1 can be ignored (updates already output to disk
due to checkpoint).
Any transactions that committed since the last checkpoint need to be redone. Hence, T2 and
T3 are to be redone.
Any transaction that was running at the time of failure needs to be undone and restarted.
Hence, T4 to be undone.
2
Question 3
Consider the following log sequence:
<T0, start>
<T0, A, 1000, 950>
<T0, B, 2000, 2050>
<T0, commit>
<T1, start>
<T1, C, 700, 600>
What will be the recovery action by immediate modification recovery? Marks:2 MCQ
Answer: c)
Explanation: A and B are set to 950 and 2050 and C is restored to 700. Log records <T1,
C, 700>, <T1, abort> are written out.
3
Question 4
Refer to the RA expression below:
E1 1θ (E2 − E3 )
a) E1 ∩ (E2 1θ E3 )
b) (E1 1θ E2 − E1 1θ E3 )
c) (E1 1θ E2 1 E1 1θ E3 )
d) (E1 1θ E2 ∩ E1 1θ E3 )
Answer: b)
Explanation: Let us rename E1 1θ (E2 − E3 ) as R1, (E1 1θ E2 ) as R2 and (E1 1θ E3 ) as
R3. It is clear that if a tuple t belongs to R1, it will also belong to R2. If a tuple t belongs to
R3, t [E3’s attributes] will belong to E3, hence t cannot belong to R1. From these two we can
say that
4
Question 5
Marks:2 MCQ
Refer to the representation of two queries in RA below
Answer: d)
Explanation: As per equivalence operation of Relational Expressions
5
Question 6
Consider the following expression below Marks:2 MSQ
a) Executing the join (work f or 1 Πprojectid,project name (project)) at first, will increase the
overall query cost
b) Executing the join (σaddress=”HighStreet” (employee) 1 work f or) at first, will increase the
overall query cost
c) The order of execution of joins do not have any impact on the query cost
d) Executing the join (σaddress=”HighStreet” (employee)) 1 work f or at first, will not increase
the overall query cost
Answer: a), d)
6
Question 7
Consider Index scan where selection condition must be on search-key of index.
Find the appropriate matching between Index and Cost. Marks:2 MCQ
Index
Cost
B) Cost = hi * (tT + tS ) + tS + tT * b
where,
tT – time to transfer one block
tS – time for one seek
hi – height of B+ Tree
b – number of blocks containing matching records
a) Index : A → Cost : A
Index : B → Cost : B
b) Index : A → Cost : B
Index : B → Cost : B
c) Index : A → Cost : A
Index : B → Cost : A
d) Index : A → Cost : B
Index : B →Cost : A
Answer: a)
Explanation: Refer slide 16 in Module 38
7
Question 8
Let us consider the following statistics for two relations students and courses:
Marks:2 MCQ
Now let us consider a natural join of students 1 courses. Identify the number of block
transfers in the worst case. Assume courses as the outer relation.
a) 302
b) 125
c) 152
d) 65
Answer: d)
Explanation: Number of block transfers is 30 * 2 + 5 = 65 if courses is the outer relation
8
Question 9
Identify the incorrect statement based on checkpointing. Marks:2 MCQ
b) Continue scanning backwards till a record < Ti start > is found for every transaction Ti in
L.
c) Scan backwards from end of log to find the most recent < checkpoint L > record.
d) Scan from starting of log to find the most recent < checkpoint L > record.
Answer: d)
Explanation: Refer slide no 29 in Module 36.
9
Question 10
What is the effect of the UNDO operation corresponding to a log record < Ti , Y, S, K > where
Ti is the transaction, and S and K are the old and new values respectively of a data location
Y? Marks:2 MCQ
a) No change to Y
d) Sets Y to 0
Answer: b)
Explanation: As per the undo operation protocol.
10