After talking about the graphic complex, we have to talk about the database complex.
No matter whether individual uses a layered reconstruction system or cooperative development, the database has been transformed. I have to admit that the original system has a strong influence on restructuring.
Before restructuring the database, the paradigm must be viewed. 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.
I. First paradigm:
No repeated columns are required. This means that each column in the database table is a basic data item that cannot be divided. The same Column cannot contain multiple values. For example, for several years, this should be two fields, instead of one field. If the first paradigm is not met, the created database is not a relational database.
For example:
Ii. Second paradigm:
The requirement is completely dependent on the primary key (removing the dependence of some molecular functions). Simply put, the attribute is completely dependent on the primary key.
The second paradigm is built on the basis of the first paradigm, that is, the second paradigm must satisfy the first paradigm first. The second paradigm requires that each record or row in the data table be able to be divided by a unique region. To implement differentiation, a column is usually added to the table to store the unique identifier of each record. For example, the student ID column in the student table and the serial number column in the computer record. I think it is actually a primary key.
In addition, the record attribute must be completely dependent on the primary keyword. That is to say, this attribute cannot depend on the primary keyword or other keywords. If yes, this attribute and the primary keyword should be separated to form a new table.
For example:
Here, the student ID and Course name determine a record, but the credits are only related to the course name, so the second paradigm is not satisfied and should be written:
(I personally think the second paradigm is used for combining primary keys with multiple fields)
Iii. Third paradigm:
The attribute must not depend on attributes other than the primary key. To put it simply, a database table must not contain non-primary key information already contained in other tables. For example, in the card table, it contains a student ID field, which has no information about the student's major or grade.
In the first table, the name and gender are uniquely identified by the student ID. Therefore, if the third paradigm is not met, the name should be written as follows:
The database paradigm is a reference. When designing a database, people who completely follow the three paradigm must not think about it by the brain, but have no idea about the three paradigms to design a database, let's just take a look at it.
Address: http://blog.csdn.net/jianxin1009/article/details/7303849