0% found this document useful (0 votes)
32 views12 pages

Database Homework Help

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
32 views12 pages

Database Homework Help

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 12

For any Homework related queries, Call us at : - +1 678 648 4277

You can mail us at : - [email protected] or


reach us at : - https://www.databasehomeworkhelp.com/

Database Homework Help


Q1.
Assume an immediate database modification scheme.
Consider the following log records for transactions TO, Tl, T2
and T3:

If there is a crash just after step 9 and the recovery of the system
is successfully completed, identify the correct actions for the
above scenario.
a) After recovery completion, value of Z will be 500.
b) After recovery completion, value of X will be 500.
c) Redo list contains transaction {T0} and undo list contains (Ti,
T2, T3}.
d) Redo list contains transactions {TO, T1.} and undo list
contains {T2, T3}.

Answer: b), C)
Q2.

Consider the log record of transaction T1 with operation instances


01 and transaction T2 with operation instances 02 used in recovery
system with early lock release, B+ tree based concurrency control.

Choose the correct set of log entries for the recovery of transactions.
Answer : C)

Q3

Assume an immediate database modification scheme. Consider


the following log records for transactions TO, Tl, T2 and T3:
If there is a crash just after step 12 and the recovery of the
system is successfully completed, identify the correct action for
the above scenario.

a) T3: Undo and TO, T1, T2: Redo


b) TO, T3: Undo and Ti, T2: Redo
c) TO, T1: No Action and T2: Redo and T3: Undo
d) T1: No Action and TO, T2: Redo and T3: Undo

Answer : C)
Q4. Let us consider the following statistics for searching for a
condition in a given relation.
Number of blocks containing record of the relation (b) = 200 Time
to transfer one block (tb) = 0.4 milliseconds Time for one seek (t5)
= 4 milliseconds Identify the cost of selection query on a key
attribute using linear search file scan.

a) 84 milliseconds
b) 50.4 milliseconds
c) 4.44 milliseconds
d) 44 milliseconds

Answer: D)

Q5.
Consider the following state of transactions and the statements
below.
1. T1, T2 and T3 can be ignored.

2. Only T1 can be ignored.

3. T2, T3 and T5 need to be redone.

4. Only T4 needs to be redone.

5. Only T5 needs to be undone.

Identify the correct group of statements from the options below.


a) 1), 2), 3), 5)

b) 1), 3), 4), 5)

c) 1), 4), 5)

d) 2), 4), 5)

Answer : C)
Q6.
Let us consider the following statistics for two relations Pizza and
SoldBy:

• Number of records of Pizza: npizza = 2000.


• Number of blocks of Pizza: bpizza = 400.
• Number of records of SoldBy: nsoidgy = 500.
• Number of blocks of SoldBy: bsaidgy = 100.

Let us consider a natural join of Pizza and SoldBy relations (Pizza


w SoldBy). Identify the required number of block transfers in the
worst case (enough memory only to hold one block of each
relation) using Nested-loop join and assume Pizza as the outer
relation.
a) 200100
b) 200400
c) 800100
d) 800500

Answer : b)
Q7.
Consider the following relational schema: Pilots(pilotid, pname,
rating, age) Flights(flightno, fname, colour)
Flies(pid, fno, date, time)

Two query trees are given below.


Identify the correct statement for the above two query trees.

a) Two query trees are equivalent as identical operations


(irrespective of their positions) are used in both the trees.
b) Two query trees are not equivalent as neither selection nor
projection operation cannot be carried out before
performing theta join.
c) Two query trees are equivalent and the query tree of Figure 1
will lead to more efficient query processing.
d) Two query trees are equivalent and the query tree of Figure 2
will lead to more efficient query processing.

Answer : C)

Q8.
Consider the following relational schema:
Pilots(pilotid, pname, rating, age)
Flights(flightno, fname, colour)
Flies(pid, fno, date, time)

Four relational algebra queries are given below:


Identify the correct options from the options given below.
a) Q1 is equivalent to Q2.
b) Q1 is not equivalent to Q2.
c) Q3 is equivalent to Q4.
d) Q3 is not equivalent to Q4.

Answer: a) c)
Q9. Identify the incorrect statement(s) from the followings.

a) The immediate modification scheme allows updates of an


uncommitted transaction to be made to the buffer, or the disk
itself, before transaction commits.
b) The deferred-modification scheme allows updates of an
uncommitted transaction to be made to the buffer, or the disk
itself, before transaction commits.
c) Physical blocks are those blocks residing on the disk.
d) System buffer blocks are those blocks which reside temporarily
in the main memory.

Answer: b)

Q10.
Consider the Relational Algebra expression given below:
where A, D, and C are relational algebra
expressions. Identify the correct equivalent relational algebra
expression of the above relational algebra expression.
Answer: b)

You might also like