Introduction to Database Paradigm

Source: Internet
Author: User
Tags unique id

Paradigm, nf,normal format, refers to the requirements of the structure of the table!

Objective: 1, standardize the structure! 2, reduce data redundancy!

First paradigm, 1NF, field atomicity

Requires fields to be no longer divided, requiring the atomicity of fields

Second paradigm, 2NF, non-part dependent

Add a unique PRIMARY key! Id

The requirements of the paradigm are gradually increasing!

Under the premise of satisfying the first paradigm, we cannot have partial dependence!

Partial dependency refers to the general field being completely dependent on the primary key, not part of the dependent primary key!

Dependency: You can use that field to determine another field

Therefore, the primary key part depends on the premise that there is a composite primary key!

What do you do?

Eliminate the composite primary key! Add a unique field to the primary key. Add a unique ID primary key that has nothing to do with business logic, int unsigned primary key auto_increment

Third paradigm, 3NF, non-dependent transfer

In the premise of satisfying the second paradigm, the cancellation of the transmission dependence is the third paradigm!

Transitive dependency: If field B has a dependency on field A, field C has a dependency on field B. There is a delivery dependency!

Resolve, to ensure that all fields are completely dependent on the primary key, and do not depend on other fields!

Save independent entity information using independent relationships (two-dimensional tables)!

Introduction to Database Paradigm

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.