1NF and 2NF

Question 1: Can we achieve 2NF without 1NF. Also differentiate 1NF and 2NF with an example.

Soln:-

No, we cannot achieve 2NF without 1NF.

First normal form (1NF) sets the very basic rules for an organized database:

* Eliminate duplicative columns from the same table.

* Create separate tables for each group of related data and identify each row with a unique column or set of columns (the primary key).

Second Normal Form (2NF)

Second normal form (2NF) further addresses the concept of removing duplicative data:

* Meet all the requirements of the first normal form.

* Remove subsets of data that apply to multiple rows of a table and place them in separate tables.

* Create relationships between these new tables and their predecessors through the use of foreign keys.

Question 2:How is the concept of functional dependency associated with the process of normalization?

Soln:-

THE RELATIONSHIP BETWEEN THE TWO ATTRIBUTES OF THE SAME RELATIONAL TABLE IS KNOWN AS FUNCTIONAL DEPENDENCY. AMONG THE TWO ATTRIBUTES ONE IS THE DETERMINANT AND OTHER IS KNOWN AS DETERMINED.THERE IS ONLY SINGLE VALUE OF THE DETERMINED IN ASSOCIATION WITH EACH DETERMINANT.

FOR EXAMPLE: IF H1 IS DETERMINANT AND H2 IS DETERMINED THEN WE SAY H1 FUNCTIONALLY DEFINES H2 OR WE REPRESENT IT AS: H1->H2. HERE FOR EACH VALUE OF H1 THERE SHOULD ONLY BE ONE VALUE IN H2.

THE CONCEPT OF FUNCTIONAL DEPENDENCY IS USED IN NORMALISATION . WE REMOVE THESE FUNCTIONAL DEPENDENCIES TO CONVERT OUR COMPLEX RELATIONS INTO SIMPLER FORMS.

Question 4: Draw the state diagram showing various states of a transaction. Also give the working of this diagram.

Answer :-

ACTIVE

These are the five transaction passes:

1.Active :-where the transaction under execution is called as active state.

2.Partially Committed:- the last transaction executing state.

3.Failed:-If normal execution cannot proceed .

4. Committed:-If execution is successfully completed.

5.Aborted:-A transaction is said to be in aborted state if it is rolled back because of some failure.

Question 5: Make a comparison between conflict and view serializability with an example.

Soln:-

A SERIALIZABLE SCHEDULE IS ONE THAT IS EQUIVALENT TO SERIAL EXECUTION OF TRANSACTIONS. IN SERIALISABILITY OF TRANSACTION SCHEDULE WE HAVE TO FIRST FIND NON SERIAL SCHEDULES THAT ARE EXECUTING TRANSACTIONS CONCURRENTLY WITHOUT DISTURBING EACH OTHER, AND THEN CONVERT THEM INTO SERIAL SCHEDULES.

EX: NON-SERIAL SCHEDULE A=700, B=800.IN THE FOLLOWING TRANSACTIONS T1 AND T2 ARE EXECUTED CONCURRENTLY.T1 DOES NOT KNOW WHAT T2 HAS MODIFIED OR VICE-VERSA.AND THE PROBLEM THAT ARISES IN SERIALIZIBLITY IS DESCRIBED IN NEXT PROBLEM;

T1

T2

READ(A)

A=A+100

WRITE(A)

READ(B)

B=B-100

WRITE(B)

READ(A)

A=A*7.06

WRITE(A)

READ(B)

B=B*7.06

WRITE(B)

THE MAIN OBJECTIVE OF SERIALZIBILITY IS TO AVOID INCONSISTENCY PROBLEM WHICH ARISES WHEN INSTRUCTIONS INTERFERE EACH OTHER WHILE EXECUTING CONCURRENTLY.

YES,NON SERIAL SCHEDULE RESULT IN CONCURRENCY RELATED PROBLEM.AND THE PROBLEM IS THE CONFLICT OPERATIONS WHILE EXECUTING CONCURRENT TRANSACTIONS.

1.)NO CONFLICT WHEN T1 AND T2 READ A DATA OBJECT.

2.)WHEN T1 WRITES AND T2 WRITES/READS THE SAME DATA OBJECT.

3.) WHEN T1 AND T2 PERFORM OPERATIONS ON SEPARATE DATA OBJECTS , THEN NO CONFLICT

FOR EX: CONFLICT PROBLEM

T1

T2

READ(A)

WRITE(A)

READ(B)

WRITE(B)

READ(A)

WRITE(A)

READ(B)

WRITE(B)

THE SOLUTION TO THIS IS TO CONVERT IT INTO SERIAL SCHEDULE.

T1

T2

READ(A)

WRITE(A)

READ(B)

WRITE(B)

READ(A)

WRITE(A)

READ(B)

WRITE(B)

Question 6: Are the ACID properties of a transaction essential to ensure the integrity of data? Give an example of each property.

Answer :-

A stand for Atomiticity in this transaction either no changes have been done to the database or the database has been changed in a consistent manner .for eg:- suppose if we transfer amount from account A to account B then, if the transaction is completed the balance of A will be lower and the balance of B will be higher. But if the transaction is aborted then, neither of the balance will be changed.

C stand for Consistency :-when the database was in a consistent state before the transaction starts then, it must be in a consistent state after the termination of the transaction lets take an example:- suppose if we transfer amount from account A to account B then, if the transaction is completed the balance of A will be lower and the balance of B will be higher. But consistency requirement is that the sum of accounts A and B must be changed.

I stands for Isolation:- In this property we says that even though more than one transaction are executing concurrently, they are unaware of actions performed by each other.

D stands for durability :- In this property we says that once a transaction completes successfully (commits),the changes it has made to the database are permanent.

Please be aware that the free essay that you were just reading was not written by us. This essay, and all of the others available to view on the website, were provided to us by students in exchange for services that we offer. This relationship helps our students to get an even better deal while also contributing to the biggest free essay resource in the UK!