# 1NF and 2NF

### 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.

### 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.

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.

### 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

A=A+100

WRITE(A)

B=B-100

WRITE(B)

A=A*7.06

WRITE(A)

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

WRITE(A)

WRITE(B)

WRITE(A)

WRITE(B)

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

T1

T2

WRITE(A)

WRITE(B)

WRITE(A)

WRITE(B)