Database: Three Paradigms

        
The first paradigm:
first paradigm (1NF) means for each column of a database table are indivisible basic data items, the same column can not have multiple values, i.e., the entity can not have an attribute value, or not have a plurality of repeat properties. If duplicate attribute appears, it may be necessary to define a new entity, the new entity composed of repeating attribute to-many relationship between the new entity and the original entities. Each row in the first paradigm (1NF) table contains only one example of information. In short, the first paradigm is no duplicate column.
1NF relations in line with each property can not be divided
This table is not 1NF:
Here Insert Picture Description
Example:
Each field can only store a single value

student ID course
1 mathematics
1 English
2 Chinese

Each record must be able to use a single master key to be identified, can not duplicate the group

student ID course class
1 mathematics Class 2
2 mathematics Class 2

The first paradigm is the basic requirement of the relational schema
second paradigm :
Second Normal Form (2NF) is established on the basis of first normal form (1NF) on that second normal form (2NF) must be met first normal form ( 1NF). The second paradigm (2NF) requires each instance or a database table row must only area may be divided. To achieve the distinction typically requires adding a column to the table, to uniquely identify each instance storage. Such as employee information table together with the employee number (emp_id) column, because each employee's employee number is unique, so each employee can be uniquely distinguished. This unique property is called the primary key column or primary key, the main code.
== second paradigm (2NF) required attributes of the entity is completely dependent on the primary key ==
Table

student ID course fraction
1 mathematics 99

Table II

student ID class head teacher
1 Class 2 Old class

Third Normal Form :
third normal form (3NF) must satisfy the second paradigm (2NF). Briefly, a third paradigm (3NF) requires a database table comprising a non-primary key information is not already included in other tables. For example, there is a department information table, where each department has a department number (dept_id), department name, department briefings and other information. Then the department number listed in the employee information table after the department can no longer name, department briefings and other information related to the department added staff information table. If the department information table does not exist, according to the third normal form (3NF) should build it, otherwise there will be a lot of data redundancy.
The third paradigm is not dependent on other properties of non-primary property. That is, if there is a non-primary property dependent transfer function codes, not meet the requirements of 3NF.

student ID head teacher
1 Old class
student ID class
1 Class 2

Below do not meet 3NF, know the class, the teacher will know the same, saying that depends on the class pass code (Student ID)

student ID class head teacher
1 Class 2 Old class
Published 39 original articles · won praise 1 · views 1162

Guess you like

Origin blog.csdn.net/alidingding/article/details/104587298