Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can anyone explain me 1NF, 2NF, 3NF, BCNF rules with a proper example?

This is a common interview question. I faced one interview where the interviewer gave me one table and asked me tell him which normal form the table is in? If it's in ##NF, then normalize it to the next NF?

I'm always get confused between these normal forms of database. Can anyone explain to me these normal forms with a proper example of how each NF is modeled into table so it will help in my next interview?

like image 419
Vishwanath Dalvi Avatar asked Jan 14 '11 14:01

Vishwanath Dalvi


People also ask

What is 1NF 2NF and 3NF with examples?

A relation is in 1NF if it contains an atomic value. A relation will be in 2NF if it is in 1NF and all non-key attributes are fully functional dependent on the primary key. A relation will be in 3NF if it is in 2NF and no transition dependency exists. A stronger definition of 3NF is known as Boyce Codd's normal form.

What is 1NF 2NF 3NF?

What Is Normalization in SQL? 1st Normal Form (1NF) Second Normal Form (2NF) Third Normal Form (3NF)

What is normalization explain different types of normal forms with example?

Normalization is the process of minimizing redundancy from a relation or set of relations. Redundancy in relation may cause insertion, deletion, and update anomalies. So, it helps to minimize the redundancy in relations. Normal forms are used to eliminate or reduce redundancy in database tables.

What are the four 4 types of database normalization?

First Normal Form (1 NF) Second Normal Form (2 NF) Third Normal Form (3 NF) Boyce Codd Normal Form or Fourth Normal Form ( BCNF or 4 NF)


1 Answers

Boyce Codd Normal Form is really the most important and also the easiest to explain: Every non-trivial determinant is a superkey (just remember "arrows out of superkeys"). The lesser normal forms are only worth mentioning because BCNF is not dependency-preserving in a few cases.

Examples of BCNF and 5NF by Hugh Darwen:

  • Database Design Issues: Part I
  • Database Design Issues: Part II

For more mathematical definitions (Abiteboul et al):

  • Foundations of Databases: The Logical Level
like image 191
nvogel Avatar answered Oct 05 '22 10:10

nvogel