The relationships in relational databases must meet certain requirements, that is, they must meet different paradigms. Currently, relational databases have six paradigms: 1NF, 2NF, 3NF, 4NF, and 5NF) and the sixth paradigm (6NF ). The first paradigm (1NF) meets the minimum requirements ). The second Paradigm (2NF) that meets more requirements on the basis of the first paradigm, and the other paradigms are similar. Generally, databases only need to satisfy the 3NF.
The paradigm mentioned in many documents is hard to understand. Here, we will summarize the three paradigms for readers to easily understand.
1NF: fields are atomic and cannot be divided;
2NF: primary key exists. non-primary key fields depend on the primary key. Make sure that a table only describes one thing
3NF: non-primary key fields cannot depend on each other. Each column has a direct relationship with the primary key, and there is no dependency for passing.
Example of the first paradigm:
Table: Field 1, Field 2 (field 2.1, field 2.2), Field 3 ......
Example of the second paradigm:
Table: Student ID, course number, name, and credits;
This table clearly shows two transactions: Student Information and course information. Because the non-primary key field must depend on the primary key, the credits here depend on the course number, and the name depends on the student number, it does not conform to the second paradigm.
Third paradigm: examples that do not conform to the third paradigm:
Table: Student ID, name, age, school, school contact number, school contact number
Dependent transmission: (student ID) → (school location, school phone number)