Definition of the three major paradigms of MySQL database: ------- the best answer you want, mysql paradigm

Source: Internet
Author: User

Definition of the three major paradigms of MySQL database: ------- the best answer you want, mysql paradigm

First paradigm: Ensure the atomicity of each column.
If each column (or each attribute) is the smallest data unit that cannot be further divided (also known as the smallest atomic unit), the first paradigm is satisfied.
Example: Customer table (name, number, address ,......) The "Address" column can also be subdivided into countries, provinces, cities, and districts.

Second paradigm: Based on the first paradigm, the goal is to ensure that each column in the table is related to the primary key.
If a link satisfies the first paradigm and all columns except the primary key depend on the primary key, the second paradigm is satisfied.
For example: Order table (Order Number, product number, order date, price ,......), "Order Number" is the primary key, and "product number" does not have a direct relationship with the primary key column. That is, the "product number" column does not depend on the primary key column and should be deleted.

Third paradigm: Based on the second paradigm, the goal is to ensure that each column is directly related to the primary key column, rather than indirectly related.
If a link satisfies the second paradigm, and other columns except the primary key do not depend on the primary key column, the third paradigm is satisfied.
To understand the third paradigm, dependencies must be transmitted according to one of Armstrong kilometers. Assume that A, B, and C are three properties of relational R. If A-> B and B-> C, A-> C can be obtained from these function dependencies, as described above, dependency A-> C is used to pass dependencies.
For example: Order table (Order Number, order date, customer number, customer name ,......), At first glance, this table is correct. The second paradigm is met. Each column is related to the "Order Number" of the primary key column. Later, you will find that "customer name" is related to "customer number, the "customer number" and "Order Number" are related, and finally the dependencies are passed. The "customer name" is also related to "Order Number. To satisfy the third paradigm, remove the "customer name" column and put it in the customer table.




Function
In fact, designing any database application system, no matter what data model is based on, will encounter the problem of how to construct an appropriate data model, that is, the logical structure. Since the relational model has a strict mathematical theory basis, it can be converted to other data models. Therefore, we need to design a proper relational model to make its logical structure more compliant with the requirements, and there is a Standardization Theory. The three major paradigms are the first, second, and third paradigms, which are important parts of the Standardization Theory. They are designed to better solve data redundancy, check data effectiveness, and improve storage efficiency. There are also the fourth and fifth paradigms. The role of the first paradigm is that the attributes of each link are atomic and cannot be divided. That is, the table cannot have a table. Satisfying the second paradigm must satisfy the first paradigm. The second Paradigm (2NF) requires that each instance or row in the database table be able to be distinguished by a unique region. The third paradigm (3NF) must satisfy the second Paradigm (2NF) first ). In short, the third paradigm (3NF) requires that a database table do not contain information about non-primary keywords already contained in other tables.

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.