0% found this document useful (0 votes)
44 views10 pages

DBMS Classtest2

1. The document contains questions for a Database Management Systems class test covering topics like normal forms, dependencies, concurrency control, crash recovery, and logging. 2. The questions define concepts like join dependency and multi-valued dependency, and ask about normal forms like 3NF, BCNF, and 5NF. Concurrency control problems and protocols like two-phase locking are also discussed. 3. Logging techniques like write-ahead logging and ARIES are covered, as are recovery processes like media recovery and crash recovery to restore consistency after failures.

Uploaded by

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

DBMS Classtest2

1. The document contains questions for a Database Management Systems class test covering topics like normal forms, dependencies, concurrency control, crash recovery, and logging. 2. The questions define concepts like join dependency and multi-valued dependency, and ask about normal forms like 3NF, BCNF, and 5NF. Concurrency control problems and protocols like two-phase locking are also discussed. 3. Logging techniques like write-ahead logging and ARIES are covered, as are recovery processes like media recovery and crash recovery to restore consistency after failures.

Uploaded by

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

DATABASE MANAGEMENT SYSTEMS CLASS TEST 2 QUESTIONS

S.NO. UNIT-III & IV QUESTIONS


1. Define Join Dependency. Explain 5NF with an Example.
2. What is multi valued dependency? State and explain fourth normal form based on this concept.
3. Explain 3NF & BCNF. What is the difference between them
4. Explain the concept of Deadlock and how to Prevent deadlocks in Time based stamp Protocol.
5. What is Concurrency Control and explain its problems.
6. Explain Serializability and role of 2PL Protocol.
7. Explain Aries in Detail and Explain “Write-Ahead Log Protocol”.
8. What is Media Recovery?
9. What is Crash Recovery Techniques in Database?

1.Define join dependency explain 5NF with example?

Join dependency or JD is a constraint that is similar to FD (functional


dependency) or MVD (multivalued dependency). JD is satisfied only when the
concerned relation is a join of a specific number of projections. Thus, such a type of
constraint is known as a join dependency.
The 5NF (Fifth Normal Form) is also known as project-join normal form. A relation
is in Fifth Normal Form (5NF), if it is in 4NF, and won't have lossless decomposition
into smaller tables. You can also consider that a relation is in 5NF, if the candidate
key implies every join dependency in it.
2. What is multi valued dependency? State and explain fourth normal form based on this
concept

A. Multivalued dependency occurs when there are more than one independent
multivalued attributes in a table. This is an example of multivalued
dependency: An item depends on more than one value. In this example, the
course depends on both lecturer and book. Thus, 4NF states that a table should not
have more than one of these dependencies. 4NF is rarely used outside of
academic circles.

3. Explain 3NF & BCNF. What is the difference between them.

A given relation is said to be in its third normal form when it's in 2NF but has no
transitive partial dependency. Meaning, when no transitive dependency exists for
the attributes that are non-prime, then the relation can be said to be in 3NF.

3NF
 There shouldn’t be any transitive dependency.
 There shouldn’t be any non-prime attribute that depends transitively on
a candidate key.
 It is not as strong as BCNF.
 It has high redundancy.
 The functional dependencies are already present in INF and 2NF.
 It is easy to achieve.
 It can be used to achieve lossless decomposition
BCNF
 For any relation A->B, ‘A’ should be a super key of that specific relation.
 It is stronger than 3NF.
 The functional dependencies are present in 1NF, 2NF and 3NF.
 It has low redundancy in comparison to 3NF.
 The functional dependencies may or may not be preserved.
 It is difficult to achieve lossless decomposition using BCNF.

4. Explain the concept of Deadlock and how to Prevent deadlocks in Time based stamp
Protocol.

A. a deadlock is an unwanted situation in which two or more transactions are


waiting indefinitely for one another to give up locks. Deadlock is said to be
one of the most feared complications in DBMS as it brings the whole system
to a Halt.
5. What is Concurrency Control and explain its problems.

A. Concurrency can simply be said to be executing multiple transactions at a time. It


is required to increase time efficiency. If many transactions try to access the same
data, then inconsistency arises. Concurrency control required to maintain consistency
data. This leads to the following problems −
 Lost update problem (write-write conflict)
 Temporary update or dirty read problem (write-read conflict).
 Unrepeatable read or incorrect analysis problem (read-write conflict).

Lost update problem


One transaction does some changes and another transaction deletes those changes.
One transaction nullifies the updates of another transaction.
Two transactions T1 and T2 read, modify, write to the same data item in an
interleaved fashion for which an incorrect value is stored in x. T2 reads the value of
X before T1 changes it hence the updated value resulting from T1 is lost.
Temporary update problem or dirty read problem
One variable has been updated in one transaction, at the same time another
transaction has started and deleted the value of the variable where the variable is
not getting updated or committed. That has been done on the first transaction; this
gives us false values or the previous values of the variables; this is a major problem.
T2 reads the update value of X made by T1, but T1 fails and rolls back. So, T2 reads
an incorrect value of X.
The final value of x is 15, which is incorrect

Unrepeatable read or incorrect analysis problem


One transaction is updating multiple different variables and another transaction is in
a process to update those variables. The problem occurs is inconsistency of the same
variable in different instances.
T1 consists of two parts – subtract 5 from X and add 5 to Y.
In T2, the value of X is updated but the value of Y is not updated. The sum variable
stores an incorrect value. Following protocols are used to control concurrency and
preserve consistency

6.Explain Serializability and role of 2PL Protocol


Serializability is the classical concurrency scheme. It ensures that a
schedule for executing concurrent transactions is equivalent to one that
executes the transactions serially in some order. It assumes that all accesses
to the database are done using read and write operations.
Two Phase Locking Protocol also known as 2PL protocol is a method
of concurrency control in DBMS that ensures serializability by applying a lock to
the transaction data which blocks other transactions to access the same data
simultaneously. Two Phase Locking protocol helps to eliminate the concurrency
problem in DBMS. This locking protocol divides the execution phase of a
transaction into three different parts.

 In the first phase, when the transaction begins to execute, it requires


permission for the locks it needs.
 The second part is where the transaction obtains all the locks. When a
transaction releases its first lock, the third phase starts.
 In this third phase, the transaction cannot demand any new locks.
Instead, it only releases the acquired locks.

This locking protocol divides the execution phase of a transaction into three
different parts.

 In the first phase, when the transaction begins to execute, it requires


permission for the locks it needs.
 The second part is where the transaction obtains all the locks. When a
transaction releases its first lock, the third phase starts.
 In this third phase, the transaction cannot demand any new locks.
Instead, it only releases the acquired locks.

The Two-Phase Locking protocol allows each transaction to make a lock or


unlock request in two steps:

 Growing Phase: In this phase transaction may obtain locks but may not
release any locks.
 Shrinking Phase: In this phase, a transaction may release locks but not
obtain any new lock

It is true that the 2PL protocol offers serializability. However, it does not ensure
that deadlocks do not happen.
7. Explain Aries in Detail and Explain “Write-Ahead Log Protocol”

A. ARIES stands for “Algorithm for Recovery and Isolation Exploiting Semantics.” It was
designed to support the needs of industrial strength transaction processing systems. ARIES
uses logs to record the progress of transactions and their actions which cause changes to
recoverable data objects. The log is the source of truth and is used to ensure that committed
actions are reflected in the database, and that uncommitned actions are undone.
Conceptually the log is a single ever-growing sequential file (append-only). Every log record
has a unique log sequence number (LSN), and LSNs are assigned in ascending order.

Write Ahead Log Protocol (WAL) means that:


  UNDO information for an update must reach the log before the update is applied to the non-
volatile copy of the DB.!
  REDO information must reach the log before the commit record for the transaction gets
there (i.e. before we promise not to lose its updates). Likewise, for UNDO information, so we
can go either way for the two-phase commit (distributed DBMS only)

8. What is Media Recovery?

If you restore the archived redo log files and data files, then you must perform media recovery
before you can open the database. Any database transactions in the archived redo log files not
reflected in the data files are applied to the data files, bringing them to a transaction-consistent
state before the database is opened.

Media recovery requires a control file, data files (typically restored from backup), and online and
archived redo log files containing changes since the time the data files were backed up. Media
recovery is most often used to recover from media failure, such as the loss of a file or disk, or a
user error, such as the deletion of the contents of a table.

Media recovery can be a complete recovery or a point-in-time recovery. Complete recovery can
apply to individual datafiles, tablespaces, or the entire database. Point-in-time recovery applies to
the whole database (and also sometimes to individual tablespaces, with automation help from
Oracle Recover Manager (RMAN)).

9. What is Crash Recovery Techniques in Database?


Crash recovery is the process by which the database is moved back to a consistent and
usable state. This is done by rolling back incomplete transactions and completing
committed transactions that were still in memory when the crash occurred

figure 1. Rolling back units of work (crash recovery)


if the database or the database manager fails, the database can be left in an inconsistent
state. The contents of the database might include changes made by transactions that were
incomplete at the time of failure. The database might also be missing changes that were
made by transactions that completed before the failure but which were not yet flushed to
disk. A crash recovery operation must be performed in order to roll back the partially
completed transactions and to write to disk the changes of completed transactions that
were previously made only in memory.

You might also like