Download as pdf or txt
Download as pdf or txt
You are on page 1of 2

Weekly exercises 5

1. List and discuss the ACID characteristics

2. Fill in the blanks / Multiple-choice questions


1. __ ensures that once transaction changes are done, they cannot be undone or lost,
even in the event of a system failure.
durability
2. If several concurrent transactions are executed over the same data set and the
second transaction updates the database before the first transaction is finished, the
__ property is violated and the database is no longer consistent.
isolation
3. Deadlocks are possible only when one of the transactions wants to obtain a(n) __ lock
on a data item.
exclusive
4. A DBMS uses a transaction __ to keep track of all transactions that update the
database.
log
5. When a program is abnormally terminated, equivalent of a __ command occurs.
rollback
6. In a(n) __ backup of the database, only the last modifications to the database are
copied.
differential
7. A __ database state is one in which all data integrity constraints are satisfied. fixed,
consistent
8. The __ statement is used to end a successful transaction.
commit
9. __ means that the data used during the execution of a transaction cannot be used by
a second transaction until the first one is completed.
isolation
10. All transactions are controlled and executed by the DBMS (subject to some limitations)
to guarantee database __.
integrity
11. __ will check whether all the operation of a transaction completed or none.
consistency
3. What does the statement ‘a transaction is a logical unit of work’ imply?
Ans. It means that a transaction must be entirely completed or aborted, allowing no other
intermediate steps. If a transaction composes of several DB requests, all of these steps
must be fulfilled to ensure acceptance of the transaction.
4. Why the DB needs its own cache management?
Ans. The DBMS knows more about its queries and can choose which individual blocks it
caches. It helps control writing back to disk better

5. What is a consistent DB state? How is it achieved?


Ans. A consistent database state is one in which all data integrity constraints are satisfied.
It is achieved by taking the DB from one consistent state to another, appropriately taking
care of each transaction.

6. What are the main types of Concurrency control? In what situation would you prefer one
over another?
Ans.
Optimistic: interactions carried on; prohibited interactions are cleared by rollback.
Pessimistic: no prohibited interactions are allowed to occur in the first place occur, hence
limited parallelism.
Benefit of optimistic: If things rarely go wrong, we won’t have to do extra work.
Benefit of pessimistic: If things do often go wrong, we don't have loads of rollbacks.

You might also like