Paradigm, nf,normal format, refers to the requirements of the structure of the table!
Objective: 1, standardize the structure! 2, reduce data redundancy!
First paradigm, 1NF, field atomicity
Requires fields to be no longer divided, requiring the atomicity of fields
Second paradigm, 2NF, non-part dependent
Add a unique PRIMARY key! Id
The requirements of the paradigm are gradually increasing!
Under the premise of satisfying the first paradigm, we cannot have partial dependence!
Partial dependency refers to the general field being completely dependent on the primary key, not part of the dependent primary key!
Dependency: You can use that field to determine another field
Therefore, the primary key part depends on the premise that there is a composite primary key!
What do you do?
Eliminate the composite primary key! Add a unique field to the primary key. Add a unique ID primary key that has nothing to do with business logic, int unsigned primary key auto_increment
Third paradigm, 3NF, non-dependent transfer
In the premise of satisfying the second paradigm, the cancellation of the transmission dependence is the third paradigm!
Transitive dependency: If field B has a dependency on field A, field C has a dependency on field B. There is a delivery dependency!
Resolve, to ensure that all fields are completely dependent on the primary key, and do not depend on other fields!
Save independent entity information using independent relationships (two-dimensional tables)!
Introduction to Database Paradigm