Paradigm Theory, database Paradigm Theory
Currently, relational databases have six paradigms: 1NF, 2NF, 3NF, 4nf, and 5NF ), the sixth paradigm (6NF ). The paradigm that meets the minimum requirements is the first paradigm. The second paradigm that meets more requirements on the basis of the first paradigm is called the second paradigm, and the rest of the paradigms are in turn. Generally, databases can meet the third paradigm.
The first paradigm is the lowest requirement for Standardization. The first paradigm requires that the data table cannot have duplicate records, that is, there is a keyword. The second requirement of 1NF is that each field cannot be further divided, that is, it has been assigned to the minimum value. The definition of relational database determines that the database meets this condition. The first paradigm is the minimum requirement for designing a database table. Its primary feature is that the attributes of an object cannot be divided. ing to a table means that columns (fields) cannot be divided, as shown below:
Student ID |
Name |
Contact info |
101 |
Li Xiaofeng |
0995-23451214 675423369 |
The above contact information can be further divided, which does not conform to the first paradigm. We should change it like this:
Student ID |
Name |
Phone number |
QQ |
101 |
Li Xiaofeng |
0995-23451214 |
675423369 |
Second paradigm:
If a link belongs to 1NF and all the non-primary key fields fully depend on the primary key word, it is called the second paradigm, which is abbreviated as 2NF.
Name |
Talent show Course |
Teaching materials |
Zhang San |
Struts2 |
Struts2 full manual |
Li Si |
Struts2 |
Struts2 full manual |
Li Si |
Oracle12c |
Oracle development manual |
The table above conforms to the first paradigm, but the data above shows that the name corresponds to the course of the draft, but the name does not correspond to the teaching material, however, the draft courses are related to teaching materials, so we should design the following table:
Name |
Talent show Course |
Zhang San |
Struts2 |
Li Si |
Struts2 |
Li Si |
Oracle12c |
Course |
Teaching materials |
Oracle12c |
Oracle development manual |
Struts2 |
Struts full manual |
Third paradigm
If a link belongs to 2NF, and each non-Keyword is not transmitted dependent on the primary keyword, this relationship is 3NF. As follows:
Learn well |
Name |
Class |
Department |
101 |
Zhang San |
Class C ++ 1 |
Computer technology |
102 |
Li Si |
English Class 1 |
Foreign language major |
The above expression conforms to the second paradigm, but if we already know the class where the student is located, we can also know the department where the student is located, that is to say, additional information is redundant. We have the following designs:
Learn well |
Name |
Class |
101 |
Zhang San |
Class C ++ 1 |
102 |
Li Si |
English Class 1 |
Class |
Department |
Class C ++ 1 |
Computer technology |
English Class 1 |
English Class 1 |