Make DB tables great by normalization

Introduction

Nowadays, almost all scalable softwares are connected to database for data persistence need.

Relational database is the most common and widely-used one, without that no any data can be stored and reused.

The relationship and organization inside the database are always an important section to make data collected well.

Thus, DB normalization was then proposed and become the guildline of making relational DB tables.

It mainly eliminates irrelevant fields and duplication of data, to give normal data manipulation and data integrity.

Rules

There are the progressive rules for database normalization, if obey then they call “1st/2nd/3rd normal form”.

db-normalization-graph

Level 1: 1st normal form

  • Eliminate repeating groups in individual tables
  • Create a separate table for each set of related data
  • Identify each set of related data with a primary key

Level 2: 2nd normal form

  • Create separate tables for sets of values that apply to multiple records
  • Relate these tables with a foreign key

Level 3: 3rd normal form

  • Eliminate fields that do not relate to the key item to become atomic

For more detailed instruction, this poster provides the full solution.

Comments