Normalization in MYSQL

前端 未结 5 2183
囚心锁ツ
囚心锁ツ 2020-11-22 12:58

What is normalization in MySQL and in which case and how we need to use it?

5条回答
  •  遇见更好的自我
    2020-11-22 14:00

    Normalization is not for MYSql only. Its a general database concept.

    Normalization is the process of efficiently organizing data in a database. There are two goals of the normalization process: eliminating redundant data (for example, storing the same data in more than one table) and ensuring data dependencies make sense (only storing related data in a table). Both of these are worthy goals as they reduce the amount of space a database consumes and ensure that data is logically stored.

    Normal forms in SQL are given below.

    First Normal form (1NF): A relation is said to be in 1NF if it has only single valued attributes, neither repeating nor arrays are permitted.

    Second Normal Form (2NF): A relation is said to be in 2NF if it is in 1NF and every non key attribute is fully functional dependent on the primary key.

    Third Normal Form (3NF): We say that a relation is in 3NF if it is in 2NF and has no transitive dependencies.

    Boyce-Codd Normal Form (BCNF): A relation is said to be in BCNF if and only if every determinant in the relation is a candidate key.

    Fourth Normal Form (4NF): A relation is said to be in 4NF if it is in BCNF and contains no multivalued dependency.

    Fifth Normal Form (5NF): A relation is said to be in 5NF if and only if every join dependency in relation is implied by the candidate keys of relation.

    Domain-Key Normal Form (DKNF): We say that a relation is in DKNF if it is free of all modification anomalies. Insertion, Deletion, and update anomalies come under modification anomalies

    Seel also

    Database Normalization Basics

提交回复
热议问题