Database Normalization

 The primary goal of normalization is to organize the attributes (columns) and tables (relations) in a database.

By adhering to a set of formal rules (known as normal forms), we ensure that data dependencies are properly enforced by database integrity constraints.

FIRST NORMAL FORM - 1NF

1NF is a fundamental concept that ensures a table meets specific criteria to be considered normalized.

A relation (table) is in 1NF if it satisfies the following conditions:

  • Every attribute (column) contains only individual and non-repeating values.
  •  Each row can be uniquely identified by a primary key.

Why Is 1NF Important?

  • Data Integrity: It prevents redundancy and ensures consistent data.
  •  Query Efficiency: Simplifies queries and operations.
  •  Flexibility: Increases data independence.

 SECOND NORMAL FORM - 2NF

Its primary objective is to further reduce data redundancy and ensure data integrity in a relational database.

To be in 2NF, a relation (table) must meet the following criteria:

  • It is already in First Normal Form (1NF).
  •  There are no partial dependencies on the primary key.
  •  Partial dependency occurs when a non-prime attribute (an attribute not part of any candidate key) depends on only a proper subset of the candidate key.
  •  In simpler terms, every non-primary-key attribute must be fully functionally dependent on the entire primary key.
  •  To achieve 2NF, we split the table into two separate tables

THIRD NORMAL FORM - 3NF

3NF is a level of database normalization that builds upon the First Normal Form (1NF) and Second Normal Form (2NF).


Its primary goal is to eliminate transitive dependencies within a relation (table).

In a transitive dependency, a non-prime attribute (an attribute not part of any candidate key) depends on another non-prime attribute.


Essentially, it means that an attribute indirectly relies on another attribute through a chain of dependencies.







 

No comments:

Post a Comment

IMAGE: CODE SPLITTING - USE COMPONENTS (NEXT JS)

 CONTACTS LIST (MAIN) contacts_list.js TEXT VERSION view.js update.js TEXT VERSION