When designing a database, some specifications need to be followed. To follow the requirements of the latter paradigm, you must first follow all the requirements of the previous paradigm. When
designing a relational database, follow different specifications and design a reasonable relational database. These different specifications are called different paradigms, and various paradigms are presented. Sub-standard, the higher the paradigm, the lower the redundancy of the database.
There are currently six paradigms in relational databases: First Normal Form (1NF), Second Normal Form (2NF), Third Normal Form (3NF), Bath-Cord Normal Form (BCNF), Fourth Normal Form (4NF) and Fifth Normal Form ( 5NF, also known as perfect paradigm).
-
classification:
-
1. The first normal form (1NF):
each column is an indivisible atomic data item
-
2. Second Normal Form (2NF):
On the basis of 1NF, non-code attributes must be completely dependent on the code (on the basis of 1NF, partial functional dependence of non-primary attributes on the main code is eliminated)-
Several concepts:
1. Functional dependency:
A–>B, if the value of the A attribute (attribute group) is used, the value of the unique B attribute can be determined. It is said that B depends on A,
for example: student ID -> name. (Student ID, course name) --> Score
2. Fully functional dependency:
A–>B, if A is an attribute group, the determination of the value of attribute B needs to depend on all attribute values in the attribute group A.
For example: (student ID, course name) --> score
3. Partial functional dependence :
A–>B, if A is an attribute group, the value of attribute B only needs to depend on some values in the attribute group A.
For example: (student ID, course name)-> name
4. The transfer function depends on :
A-> B, B-> C. If you pass the value of the A attribute (attribute group), you can determine the value of the only attribute B. The value of the attribute (attribute group) can determine the value of the unique C attribute. The transfer function of C is said to depend on A.
For example: student number -> department name, department name -> department head
5. Code:
If in a table, an attribute or The attribute group is completely dependent on all other attributes, then this attribute (attribute group) is called the code of the table.
For example: the code in the table is: (student ID, course name)* 主属性:码属性组中的所有属性 * 非主属性:除过码属性组的属性
-
- 3. Third Normal Form (3NF) : On the basis of 2NF, any non-primary attributes do not depend on other non-primary attributes (eliminate transitive dependence on the basis of 2NF)