Database Design 3 Pattern

2010-06-23  来源:本站原创  分类:Database  人气:158 

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).

相关文章
  • Database Design 3 Pattern 2010-06-23

    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 d

  • Database design mode decomposition 2010-03-13

    Database design to make the user to delete, update, insert more convenient, to avoid data redundancy, abnormal phenomena; generally follow the three paradigms, in short, 1NF: property can not be divided, that is not in the table set the table 2NF: th

  • Experience of database design: Part 1 - Design the database before 2010-03-19

    If you compared the life of the enterprise data necessary for the blood, then the database design is the most important part of the application. Voluminous material related to database design, university degree courses where there are special about.

  • Large database design principles and development techniques 2010-03-22

    With more and more widely used in computer technology in all fields of national economy, the miniaturization of computer hardware Buduan Tongshi, Ying Yong system towards Fuza of, large scale of the direction. Database is the core of the whole system

  • Experience of database design: Part 1 - Design a database before 2010-03-19

    If you compared the life of the enterprise data necessary for the blood, then the database design is the most important part of the application. Voluminous material related to database design, university degree courses where there are special about.

  • [Transfer] application example database design, analysis of the three major paradigms 2010-04-08

    Introduction Database design database design paradigm is required to meet specifications, to meet these specifications database is simple, the dimension structure, and Tong Shi, does not occur Insert (insert), Delete (delete) and Geng Xin (update) op

  • Transfer: Database Design. Norms and skills (recommended) 2010-06-01

    First, the database design process is the information resource management database technology the most effective means. Database design is for a given application environment, an optimal database schema, creating databases and applications, the effec

  • Database design skills 14 2010-06-04

    Reproduced from other sites Database design skills 14 The following 14 database design skills, many people in a large number of database analysis and design practice, gradually summed up. The use of these database design experience, flexibility and g

  • [Change] database design paradigm in layman's language 2010-07-08

    Original Address http://www.cnblogs.com/Bowen80/archive/2009/01/08/1371903.html When relational database design is to observe certain rules. In particular, database design paradigm is briefly 1NF (first normal form), 2NF (second paradigm), 3NF (third

  • Database design, "sometimes have to violate the third paradigm" (transfer) 2010-07-14

    Park on the blog to see an article on the database paradigm, "the database design of the five paradigms": Find the rules to eliminate the third paradigm is not directly dependent on the formation of the first pattern and second pattern table of

  • Reprint: Database Design Mistakes --- CHAR and VARCHAR 2010-07-26

    Database Design Mistakes (2) - CHAR and VARCHAR Character field is the most common database table fields, and character field is divided into two kinds of fixed length and variable length. In general, VARCHAR type used to store large data changes con

  • Three Forms of Application Database Design Analysis (3) 2010-07-27

    This data table keywords (user name, posting ID, reply ID) to determine the entire line: (User name, posting ID, reply ID) → (email, homepage, telephone, address, post title, post content, respond to the title, back content) However, this design does

  • Database design - Database before 2010-08-09

    1. Examine the current environment in the design of a new database, you should carefully consider not only the business needs but also to examine existing systems. Most database projects are not built from scratch; Typically, institutions always exis

  • Common database design, relationship between the 5 2010-10-29

    5 common database design relationship, which this article mainly about "multi-state" relationship between the structure, the mobile phone as an example. 1, configuration relationship - any relationship with other table table. For example: webCon

  • Experience in database design (1,2) 2010-11-18

    - From the network, the original author is unknown. . . - Zhuantie does not mean I totally agree with the view, hoping not to be misleading. . . A successful management system is: [50% + 50% of business software] is composed of While another 50% of t

  • Database design paradigm (example) 2010-12-13

    When relational database design is to observe certain rules. In particular, the database design paradigm is briefly 1NF (first normal form), 2NF (second normal form), 3NF (third normal form) and BCNF, while the fourth and fifth paradigm paradigm left

  • Application database design analysis of the three major paradigms (put it more clearly) 2011-05-09

    First say a few words: The first fruits of labor, so I find this rather vague on the paradigm now have a clearer understanding. However, with my own understanding and practical experience, which I will add some of my personal notes in order to facili

  • Database design using powerdesigner 2011-03-17

    Database design using powerdesigner really easy, here are some commonly used settings Additional: Toolbar disappeared Palette (Palette) Shortcut Bar disappeared PowerDesigner shortcut toolbar palette disappeared, how to re-open, looking back it Inter

  • Database design criteria (first second third normal form description) 2010-08-26

    I, relational database design paradigm introduced 1.1 First Normal Form (1NF) no repeat of the column The so-called first paradigm (1NF) is the database table for each column of the basic data items are indivisible, the same column can not have multi

  • Database design paradigm in layman's language 2010-10-20

    Data dependencies: 1 data dependent Data refers to is dependent on a relationship between attributes are equal or not reflected in the relationships between the data, the most important thing is functional dependency and multivalued dependency. 2 FD