Question :

What is normalization? Explain 3NF with example.

Subject

Database Management System

Standard

Computer Science Engineering

Views

648

Asked By

Angelina

Aarohi
Answer / Solution

Third Normal Form (3NF) is a database normalization technique used to further eliminate data redundancy and improve data integrity beyond 2NF. In 3NF, a table is said to be in 3NF if it is already in 2NF and every non-key attribute is not transitively dependent on the primary key.

A relation that is in First and Second Normal Form and in which no non-primary-key attribute is transitively dependent on the primary key, then it is in Third Normal Form (3NF).

To explain 3NF with an example, consider a table called "Employees" with the following columns:

  • Employee ID (primary key)
  • Employee Name
  • Department ID
  • Department Name
  • Department Head
  • Department Location

This table is not in 3NF because the non-key attribute "Department Head" is transitively dependent on the primary key through the "Department Name" column. The Department Head can be determined from the Department Name, and the Department Name can be determined from the Department ID, which is part of the primary key.

To normalize this table to 3NF, we need to split it into three tables: "Employees," "Departments," and "Department Heads."

The "Employees" table will have the following columns:

  • Employee ID (primary key)
  • Employee Name
  • Department ID (foreign key)
  • The "Departments" table will have the following columns:
  • Department ID (primary key)
  • Department Name
  • Department Location

The "Department Heads" table will have the following columns:

  • Department ID (primary key and foreign key)
  • Department Head

By doing this, we have eliminated the transitive dependency between the Employee ID and the Department Head, and we have ensured that each table contains data that is relevant and not transitively dependent on the primary key.

Qayanat
Answer / Solution

To explain 3NF with an example, consider a table called "EMPLOYEE_DETAIL " with the following columns:

EMPLOYEE_DETAIL table:

EMP_ID EMP_NAME EMP_ZIP  EMP_STATE EMP_CITY
222 Harry 201010 UP Noida
333  Stephan  02228 US Boston
444 Lan 60007 US Chicago
555 Katharine 06389 UK Norwich
666 John 462007 MP Bhopal

Super key in the table above: {EMP_ID}, {EMP_ID, EMP_NAME}, {EMP_ID, EMP_NAME, EMP_ZIP}....so on  

Candidate key: {EMP_ID}

Non-prime attributes: In the given table, all attributes except EMP_ID are non-prime.

Here, EMP_STATE & EMP_CITY dependent on EMP_ZIP and EMP_ZIP dependent on EMP_ID. The non-prime attributes (EMP_STATE, EMP_CITY) transitively dependent on super key(EMP_ID). It violates the rule of third normal form.

That's why we need to move the EMP_CITY and EMP_STATE to the new <EMPLOYEE_ZIP> table, with EMP_ZIP as a Primary key.

EMPLOYEE table:

EMP_ID EMP_NAME EMP_ZIP 
222 Harry 201010
333  Stephan  02228
444 Lan 60007
555 Katharine 06389
666 John 462007

EMPLOYEE_ZIP table:

EMP_ZIP  EMP_STATE EMP_CITY
201010 UP Noida
02228 US Boston
60007 US Chicago
06389 UK Norwich
462007 MP Bhopal

Top Trending Questions


Recent Question Update

Explain Domain Key Normal Form DKNF with example.
Explain Project Join Normal Form PJNF with example.
Explain 4nf and 5nf with example.
What is 5nf in DBMS.
What do you mean by 4NF in DBMS. Explain with example.
What is BCNF Boyce Codd Normal Form. Explain it.
What is 2NF? How is it achieved.
What is 1NF? How do we achieve it.
What are the different normal forms in DBMS?
Brief Introduction to the Normalization.
Explain multivalued dependencies
What do you mean by lossless join? How can we test it.
What is the meaning of decomposition in DBMS? List its properties.
Explain the closure of attribute sets.
What do you mean by closure of a set of functional dependencies.
Explain the inference rules for functional dependencies in DBMS
What is the Difference between BCNF and 4NF in DBMS.
SQL Full Outer Join Using Left and Right Outer Join and Union Clause
Difference between Natural join and Inner Join in SQL
Define aggregate function in database.
Write the operations which are responsible for database modification.
Explain natural join operation.
Differentiate union, intersection and set difference operations.
Explain fundamental operations of relational algebra with example.
What do you mean by database scheme. Explain with example.
What do you mean by relational algebra?
Explain Aggregation
What do you mean by Generalization and Specialization in DBMS?
Explain superclass and subclass entity types
Describe EER Model?
What is ER Entity relationship Diagram.
Explain the concept of weak entity and strong entity.
What are the entities and attributes? Explain them.
What are keys? Discuss its types.
Define relationship sets.
What do you mean by attributes? Explain its types.
What are the limitations of a database system.
Explain database administrator and its functions
Explain different database system users
What is database abstraction. Explain its levels.
Write advantages and disadvantages of Hierarchical Data Model
Write advantages and disadvantages of Network Data Model
Write advantages and disadvantages of Relational Data Model
What are data models? Explain its types.
Write different applications of a database
What are the advantages and disadvantages of a database system
Explain Database. Explain different types of elements.

Advantages Of NCERT, CBSE & State Boards Solutions For All Subjects

  • All the NCERT Solutions have been prepared by academic experts having 10+ years of teaching experience.
  • They have prepared all the solutions in simple and easy language so that each and every student can understand the concepts easily.
  • All the solutions have been explained step to step-wise in details with better explanations.
  • Students can also use these question and answers for your assignments and in homework help.
  • All the solutions have been explained in detail and the answers have been compiled in a step-wise manner.
  • All the questions and answers are commonly prepared according to the Latest Syllabus of Board Education and Guidelines.
  • Students can know about the various types of questions asked in the exams with the help of these solutions.

Top Course Categories