The three main paradigms of MySQL

Source: Internet
Author: User

Online search, original do not know: understanding
In more detail is Liu Yan teacher: https://www.zhihu.com/question/24696366/answer/29189700 back also has Wang Hongbo user's explanation can learn from
First paradigm: Ensure the atomicity of each column.
If each column (or each attribute) is the smallest data unit (also known as the smallest atomic unit) that is not re-divided, the first normal form is satisfied.
For example: Customer table (name, number, address 、......) Where the "address" column can also be subdivided into countries, provinces, municipalities, districts and so on.

second paradigm: One more layer on the basis of the first paradigm, with the goal of ensuring that each column in the table is related to the primary key.
For example: order form (order number, product number, order date, Price 、......), "order number" as the primary key, "product number" and primary key column do not have a direct relationship, that is, the "Product number" column does not depend on the primary key column, The column should be deleted.

third paradigm: on the second paradigm basis, the goal is to ensure that each column is directly related to the primary key column, rather than indirectly.
For example: Order table ( order number, ordering date, customer number, customer name, ...), first look at the table there is no problem, to meet the second paradigm, Each column is related to the primary key column "order Number", and then you will find that the "Customer name" and "customer number" are related, "customer number" and "order number" are related, and finally pass the dependency, "Customer name" and "Order number" related. In order to satisfy the third paradigm, the "Customer name" column should be removed and placed in the Customer table.

Function
In fact, designing any kind of database application system, no matter what data model it is based on, will encounter the problem of how to construct the appropriate data schema, i.e. logical structure.
Because the relational model has a rigorous mathematical theory basis, and can be converted to other data models. Therefore, we should design the appropriate relationship model, make its logical structure more conform to the requirements, and the normalization theory appears.
The three paradigms, the first, the second and the third, are the important parts of the normalization theory, which are designed to better solve the data redundancy, data validity check, and improve the storage efficiency.
In addition, there are the fourth paradigm and the five paradigm. The role of the first paradigm is to require that the attributes of each relationship be atomic and not re-divided.
Tables cannot be found in the table. Satisfying the second paradigm must satisfy the first paradigm. The second normal form (2NF) requires that each instance or row in a database table must be divided by a unique region.
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.

The three main paradigms of MySQL

Related Article

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.