Uncategorized

Normalization

It is the process of re-organizing data in the database with the aim of reducing data duplication and increasing efficiency. The process involves making tables and creating relationships between the tables according to some predefined rules of normalization.

In SQL, tables are made to relate with each other by use of keys to identify specific records.

Some of the keys used are:

  • Primary Key – Is a single column record used to uniquely recognize a record in a database record.
  • Foreign Key – Is a key used to references a primary key of another Table, in a new table, mostly used after normalization of the tables.

Normal Forms

First normal form

Rules used to normalize a table into the first normal form:

  • Generate a new separate table for each set of related data.
  • Make sure to eliminate duplicate records in the isolated tables.
  • Put each set of related data with a unique primary key.

Second normal form

  • Must satisfy the rules of first normal form.
  • Make isolated tables for each sets of values that have multiple records.
  • Relate the generated tables with foreign keys.

Third normal form

  • Must satisfy rules of second normal form.
  • Get rid of fields that do not depend on the key.

You might also like

Leave a Reply

Your email address will not be published. Required fields are marked *