The first paradigm (1NF)
In any relational database, the first paradigm (1NF) relations model is the basic requirement, does not meet the first normal form (1NF) relational database, the database is not.
The so-called first normal form (1NF) is the database table for each column of basic data items are indivisible, the same column can not have more than one value, that entity can not have more than one attribute value or property can not have duplicate . If repeated properties, it may need to define a new entity, the new entity constituted by the repetition of the property, the new entity and the original as-many relationship between entities. In the first paradigm (1NF) tables of each line contains only one instance of information. For example, for Figure 3-2 in the employee information form, can not be placed in an employee information is displayed, nor can one of two or more columns in a display; employee information table Each took only that one employee's information, an employee of the information in the table only once. In short, the first paradigm is no repeat of the column.
2 The second paradigm (2NF)
The second paradigm (2NF) is in first normal form (1NF) built on the basis that meet the second paradigm (2NF) must satisfy first normal form (1NF). The second paradigm (2NF) required for each instance of a database table or row must be the only distinction. To achieve distinction usually add a column to the table to store each instance of the unique identifier. Figure 3-2 Staff information in the table with the employee ID (emp_id) column, because the number of employees each employee is unique, so each employee can be the only distinction. This unique property known as the primary key columns or primary key, the main code.
The second paradigm (2NF) requires an entity to attribute entirely dependent on the primary key. The so-called totally dependent is dependent on primary key can not exist only as part of the property, if it exists, then this property and this part of the main keyword should be separated to form a new entity, the new entity and the original entities is one to many relations. To achieve distinction usually add a column to the table to store each instance of the unique identifier. In short, the second paradigm is the part of non-primary attributes of non-dependent on primary key.
3 The third paradigm (3NF)
Meet the third paradigm (3NF) must meet the second paradigm (2NF). In short, the third paradigm (3NF) requires a database table does not contain the table has been included in other non-primary key information. For example, there is a sector information table, where each sector of the department number (dept_id), sector name, sector profile and other information. So the information in Figure 3-2 employees department number listed in the table after the department can no longer name, department and other sector-related profile information and then joined the staff information table. If there is no sector information table, under the third paradigm (3NF) should build it, otherwise there will be a lot of data redundancy. In short, the third paradigm is the property does not depend on other non-primary attributes.
Four. Popular understanding of the paradigm of popular understanding of the three three paradigms, the database design a lot of good. In database design, in order to better apply the three paradigms, we must understand the three popular paradigms (popular enough to understand that understanding, not the most accurate understanding of science):
The first paradigm: 1NF is the property of atomic constraints, required attribute is atomic, no further decomposition;
The second paradigm: 2NF is the only constraint records, required to record a unique identity, that is, uniqueness of the entity;
The third paradigm: 3NF field redundancy is bound, that any field can not be derived from other fields, it requires no redundant fields.
No redundant database design can be done. However, there is no redundancy in the database, the database may not be the best, sometimes in order to improve efficiency, we must lower the standard paradigm, appropriate to retain redundant data. Specific approach: the conceptual data model designed to comply with the third paradigm, lowering the standard paradigm of work into consideration when designing a physical data model. Reduction paradigm is to increase the field to allow redundancy.
5. Correct understanding of data redundancy in the primary key and foreign key table in the repetition of many, not data redundancy, the concept must be clear, in fact, many people still do not know. Repeated non-key field is the data redundancy! It is a low-level redundant, repetitive or redundant. High redundancy is not a repetition of the field, but the field is derived there.
] [Cases: product of the "unit price, quantity, amount," the three fields, "Amount" is the "unit price" multiplied by "number" derived, it is redundant, but also a high redundancy. The purpose of redundancy is to improve processing speed. Only low-level redundancy will increase the data inconsistency, because the same data, may be from a different time, place, role on several input. Therefore, we advocate high redundancy (redundant derivative), against the low-level redundant (repetitive redundancy).