Three paradigms of database design principles __ Database

Source: Internet
Author: User

First of all, this article is a note record. may not be suitable as a blog article, so if looking uncomfortable, also hope "talant", (^__^) Xi hee ...

There are three paradigms in database design: The first paradigm (1NF): atomicity, data can not be divided

The principle is to make the table column atomic, and each field content can no longer be decomposed. second Paradigm (2NF): uniqueness, elimination of partial dependencies

The second normal form requires that the following two requirements be met, and each row of data is unique

This, as long as there is a primary key can be implemented. Because the presence of a primary key makes each row of data unique. eliminates partial dependencies between data

Dependency definition: The primary key determines the other fields, and the other fields are dependent on the primary key.

Partial dependency: A field value depends on a partial field, which occurs if the table's primary key location has more than one field.

Full dependency: A field is completely dependent on all fields with the primary key. When a table's primary key has only one field, it must be completely dependent. Solution:

Converts partial dependencies into full dependencies and splits the tables.

Splitting a table that was partially dependent, simply by having several fields for the table's primary key, is split into a table (several +1), and the first few fields will be the unique primary key for the table they are in, which becomes the full dependency pattern. The last table is a joint primary key that coexists with the previous few fields. Used to maintain the relationship between tables. Third Paradigm (3NF): Independence, eliminating transitive dependencies

That is, some fields have values that can be computed using existing table columns, and such fields are redundant fields that produce transitive dependencies. Solutions

Extracts the transitive dependencies section and splits the table.

Create a new table by extracting the field from the original table that has delivery dependencies. The primary key for the new table is the field that is dependent on the original table. This field will exist as a foreign key in the original table.

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.