Interview Preparation mode beta
Funny Facebook Status Funny Facebook Status
Enter your email address

Database Normalization

+1 vote
What do you know about Database Normalization?
asked 1 year ago in SQL Server Interview Questions and Answers by R (19,530 points) edited 1 year ago by R

3 Answers

Nice?Vote!
Database normalization is the process of efficiently organizing data in a database.

There are two reasons of the normalization process:
1.  Eliminating redundant data, for example, storing the same data in more than one tables.
2.  Ensuring data dependencies make sense.

Both of these are worthy goals as they reduce the amount of space a database consumes and ensure that data is logically stored. Normalization consists of a series of guidelines that help guide you in creating a good database structure.

Normalization guidelines are divided into normal forms; think of form as the format or the way a database structure is laid out. The aim of normal forms is to organize the database structure so that it complies with the rules of first normal form, then second normal form, and finally third normal form.

It's your choice to take it further and go to fourth normal form, fifth normal form, and so on, but generally speaking, third normal form is enough.

First Normal Form (1NF)

Second Normal Form (2NF)

Third Normal Form (3NF)
answered 1 year ago by R (19,530 points)
Nice?Vote!
NF1: First Normal Form: No Repeating Elements or Groups of Elements
-------
We have actually only told half the story of NF1. Strictly speaking, NF1 addresses two issues:
   1. A row of data cannot contain repeating groups of similar data (atomicity); and
   2. Each row of data must have a unique identifier (or Primary Key).

NF2: Second Normal Form: No Partial Dependencies on a Concatenated Key
-------
 For each column we will ask the question,
    Can this column exist "without" one or the other part of the concatenated primary key?

If the answer is "yes" — even once — then the table fails Second Normal Form.

NF3: Third Normal Form: No Dependencies on Non-Key Attributes
-------
Third Normal Form (3NF) requires that all columns depend directly on the primary key. Tables violate the Third Normal Form when one column depends on another column, which in turn depends on the primary key (a transitive dependency).

One way to identify transitive dependencies is to look at your table and see if any columns would require updating if another column in the table was updated. If such a column exists, it probably violates 3NF.
answered 1 year ago by R (19,530 points)
Nice?Vote!
First Normal Form
-------------------------
For a table to be in first normal form, data must be broken up into the smallest units possible.In addition to breaking data up into the smallest meaningful values, tables in first normal form should not contain repetitions groups of fields.

Second Normal form
----------------------------
The second normal form states that each field in a multiple field primary keytable must be directly related to the entire primary key. Or in other words, each non-key field should be a fact about all the fields in the primary key.

Third normal form
------------------------
A non-key field should not depend on other Non-key field.
answered 1 year ago by R (19,530 points)

Related questions