Back a little bit of database paradigm day

First, what is the role of the database paradigm?

  In order to reduce data redundancy procedures in the database, the database structure must follow certain rules. In a relational database, this rule is the paradigm. When designing a relational database, to comply with different specifications, design a reasonable relational database, which is referred to different specifications different paradigms, presenting subnormal paradigms, the higher the smaller the redundant database paradigm.

Second, the database paradigm, which has several?

  Currently there are six relational database paradigm: First Normal Form (1NF), second normal form (2NF), Third Normal Form (3NF), Bath - Cape Cod Paradigm (BCNF), fourth normal form (4NF) and fifth paradigm ( 5NF, also known as the perfect paradigm). Meet the minimum requirements of the paradigm is the first paradigm (1NF). More further satisfies regulatory requirements on the basis of the first paradigm (2NF), the remaining second paradigm paradigm called inferior race on. In general, the database only in third normal form (3NF) on the line.

Third, what is the specifications of each paradigm?

  1, the first paradigm

   In any relational database, first normal form (1NF) is the basic requirement of the relational schema, does not meet the first normal form (1NF) database is not a relational database.

   The first attribute paradigm is indivisible, i.e., each column of the database table are indivisible atomic data items, not a non-atomic set of data items, arrays, records. For example, we define an id field in the table, will not be split. But the definition of the name field, and if the name is in English, will be divided into first name and last name, so do not conform to the atomicity.

  2, the second paradigm

   1NF on the basis of non-code must be totally dependent on the properties of the candidate codes (to eliminate non-primary property 1NF part of the function on the basis of the primary key dependency).

   That is, the second paradigm required must have a primary key of the table, the table must be entirely dependent on other fields in the primary key. For example, we have defined attribute information table identities ID, then this property is unique,

In a table is not repeated, and all other information varies depending on the identity of the ID field.

  3, Third Normal Form

  2NF on the basis of any non-primary property is not dependent on other non-primary property (transfer to eliminate dependency on the basis of the 2NF)

  Is not required in the table present in other tables, information is stored in the same field, is typically implemented in de-associated foreign key, the third paradigm just remember like foreign key constraints.

  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 information can no longer with the department about the department name, department, etc. About adding 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.

  4, Bath - Cod Paradigm (BCNF) (BC Paradigm)

  In 3NF basis, any non-primary key attribute is not a subset of the primary dependent (eliminate the dependency on the primary code subset in 3NF basis)

  Bath - Cape Cod is that there is no new paradigm of design specifications to join, but for the second and third paradigm paradigm design specifications stronger, which is considered to be corrected third normal form, that is to say, it is in fact the first amendments III paradigm, the database redundancy smaller. This is also the reason for not BCNF is called the fourth paradigm.

  5. The fifth paradigm (perfect paradigm)

   Fifth normal mode refers to the relationship R R dependence implied by the candidate code.

     Re-establish the original structure from the final structure.

    The fifth normal table is divided into blocks as small as possible, in order to exclude all redundant table.

Guess you like

Origin www.cnblogs.com/syq816/p/12359722.html