Database design in six major paradigms

Source: Internet
Author: User

A paradigm is a collection of relational patterns that conform to a certain level. Relationships in relational databases must meet certain requirements, that is, to meet different paradigms.

There are currently six paradigms for relational databases: the first paradigm (1NF), the second Normal (2NF), the third Normal (3NF), the fourth Normal (4NF), the V-Normal (5NF), and the sixth (6NF). The paradigm that satisfies the minimum requirements is the first paradigm (1NF). On the basis of the first paradigm further satisfies more requirements called the second normal form (2NF), and the rest of the paradigms are in the second analogy. In general, the database only needs to meet the third normal form (3NF) on the line.

First Normal (1NF) column with no duplicates
The so-called First paradigm (1NF) refers to the fact that each column of a database table is an indivisible basic data item and cannot have multiple values in the same column, that is, an attribute in an entity cannot have multiple values or cannot have duplicate properties. If duplicate attributes are present, you may need to define a new entity, which is composed of duplicate attributes, and a one-to-many relationship between the new entity and the original entity. In the first normal form (1NF), each row of a table contains only one instance of information. In short, the first paradigm is a column with no duplicates.
Note: In any relational database, the first paradigm (1NF) is the basic requirement for relational schemas, and a database that does not meet the first normal form (1NF) is not a relational database.

the second normal form (2NF) property is completely dependent on the primary key [Eliminate partial sub-function dependencies]
The second paradigm (2NF) is established on the basis of the first paradigm (1NF), i.e. satisfying the second normal form (2NF) must first satisfy the first paradigm (1NF). The second normal form (2NF) requires that each instance or row in a database table must be divided by a unique region. It is often necessary to add a column to the table to store the unique identity of each instance.
For example, the Employee Information table adds the employee number (emp_id) column because each employee's employee number is unique, so each employee can be uniquely differentiated. This unique attribute column is called the primary key or primary key, and the main code.
The second normal form (2NF) requires that the attributes of an entity depend entirely on the primary key. The so-called full dependency is the inability to have a property that depends only on the primary key, and if so, this part of the property and the primary key should be separated to form a new entity, and the new entity is a one-to-many relationship with the original entity. It is often necessary to add a column to the table to store the unique identity of each instance. In short, the second paradigm is that properties depend entirely on the primary key.

the third normal form (3NF) property does not depend on other non-primary properties [Eliminate delivery dependencies]
Satisfying the third normal form (3NF) must first satisfy the second normal form (2NF). In short, the third paradigm (3NF) requires that a database table not contain non-primary key information already contained in other tables. For example, there is a departmental information table, where each department has a department number (dept_id), a department name, a department profile, and so on.
Then the department number is listed in the Employee Information table, the department name, department profile and other departments related information can no longer be added to the Employee Information table. If there is no departmental information table, it should be built according to the third paradigm (3NF), otherwise there will be a lot of data redundancy. In short, the third paradigm is that properties do not depend on other non-principal properties.

Description of the Paradigm

    • The first paradigm: 1NF is an atomic constraint on attributes, requiring attributes to be atomic and non-biodegradable
      The popular understanding is that the field can be divided again? If not, it is designed to meet the 1NF.
    • The second paradigm: 2NF is a unique constraint on records, requiring records to have a unique identity, that is, the uniqueness of the entity;

      A simple explanation, like you dating a girl, creating a watch, not having to record her height and weight on every treaty record, and the existence of a separate table of height and weight for enquiries.
    • The third paradigm: 3NF is a constraint on field redundancy, that is, any field cannot be derived from another field, it requires no redundancy in the field.
      For example, such as a comment form, if you put the user ID, the user picture is placed in this message table, is not appropriate. The user's avatar is dependent on the user ID and does not depend on the comment.

Database design in six major paradigms

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.