Question 1: Can we achieve 2NF without 1NF. Also differentiate 1NF and 2NF with
an example.
First normal form (1NF) sets the very basic rules for an organized database:
20002
D102 13456 30000 Jim Carter
30001
Paul Simon
Second normal form (2NF) further addresses the concept of removing duplicative
data:
Example:
Inventory
Inventory
Supplier
The above relation is now in 2NF since the relation has no non-key attributes.
Question 2: How is the concept of functional dependency associated with the process
of normalization?
Three normal forms were initially proposed, which are called first (1NF), second
(2NF) and third (3NF) normal form. Subsequently, a stronger definitionof third
normal form was introduced and is referred to as Boyce-Codd normal form (BCNF).
All of these normal forms are based on the functional dependencies among the
attributes of a relation.
F->CD
Because
A->CDandF->A
And
alsoF->CDandF->DE
So
thatF->D
Therefore
the relation R2(A,F,D) is a correct decomposition.
Now
the remaining attributes A,B,C and B->C , so there is another relation R1(A,B,C)
.So the three decomposition of relation R in R1, R2 and R3 are correct according to
the rule of functional dependency
PART- B
Question 4: Draw the state diagram showing various states of a transaction. Also give
the working of this diagram.
Initial Phase: a database transaction is in this phase while its statements start to be
executed.
Partially Committed Phase: a database transaction enters this phase when its final
statement has been executed.
At this phase, the database transaction has finished its execution, but it is still possible for the
transaction to be aborted because the output from the execution may remain residing
temporarily in main memory - an event like hardware failure may erase the output.
Failed State: A database transaction enters the failed state when its normal execution
can no longer proceed due to hardware or program errors.
Committed State: A database transaction enters the committed state when enough
information has been written to disk after completing its execution with success.
In this state, so much information has been written to disk that the effects produced by the
transaction cannot be undone via aborting; even when a system failure occurs, the changes
made by the committed transaction can be re-created when the system restarts.
We are unable to swap instructions in the above schedule to obtain either the serial
schedule < T3, T4 >, or the serial schedule < T4, T3 >.
View serializability:
Let S and S´ be two schedules with the same set of transactions. S and S´ are view
equivalent if the following three conditions are met:
1. For each data item Q, if transaction Ti reads the initial value of Q in schedule
S, then transaction Ti must, in schedule S´, also read the initial value of Q.
2. For each data item Q if transaction Ti executes read(Q) in schedule S, and that
value was produced by transaction Tj (if any), then transaction Ti must in schedule S´
also read the value of Q that was produced by transaction Tj .
3. For each data item Q, the transaction (if any) that performs the final write(Q)
operation in schedule S must perform the final write(Q) operation in schedule S´.
A schedule S is view serializable it is view equivalent to a serial schedule. Every
conflict serializable schedule is also view serializable.
Question 6: Are the ACID properties of a transaction essential to ensure the integrity
of data? Give an example of each property.
A transaction is a group of operations that have the following properties: atomic, consistent,
isolated, and durable (ACID). The support of transactions enables new types of applications
to be developed, while simplifying the development process and making the application more
robust.
In an atomic group of operations, either every operation in the group must succeed, or the
effects of all of them must be undone (also known as rolling back).
For example, a bank transfer must be an atomic set of two operations: a debit from one
account and a credit to another account. The debit and credit must be implemented as an
atomic group. If those two operations do not both succeed, then the transfer is either unfairly
in favor of the bank or the account holder.
The requirement of consistency means that the data is consistent after the transaction
(assuming that we started with a consistent system before the transaction).
For the bank transfer example, consistency may be defined as having the combined account
balance of the two accounts be a constant. To implement consistency in the bank transfer
example, the debit and credit operations simply need to be for the same amount of money.
In this case, there is a need to update and add multiple directory entries under the control of a
transaction. Not only is it necessary to have the updates be atomic, but it is also necessary that
a customer who is currently shopping must not see the updates in progress. This is an
example of the isolation property of transactions.
The property of durability requires that after an update is finished, its effects persist even if
the system stops responding.
In the previous example, durability can be provided simply by ensuring adequate data
recovery so that all new file system entries that represent the addition of a new product to the
site appear after a system stops responding. This requires a system with data backup,
recovery, and high availability mechanisms.