Cainiao database (I) Three paradigm

Source: Internet
Author: User
When it comes to software development, there is no need to talk about databases, and there is no need to talk about three paradigms. In fact, there are six database paradigms, except the first, second, and third paradigms. There are also the fourth, fifth, and one BC paradigm. Here we only discuss three paradigms. if you are interested, you can find some professional books to learn the 1NF paradigm) the first paradigm refers to the database

When it comes to software development, we can't talk about databases, but about databases. In fact, there are six database paradigms, except the first, second, and third paradigm, and the fourth, fifth, and one BC paradigm. Here we only discuss if you are interested in the three paradigm, you can find some professional books to learn the first paradigm (1NF) the first paradigm refers to the database

When it comes to software development, we can't talk about databases, but about databases. In fact, there are six database paradigms apart from the first, second, and third paradigms.

There is also the fourth fifth paradigm and a BC paradigm. Here we will only discuss three paradigms. If you are interested, you can find some professional books for further study.


1NF)

The first paradigm means that each column in the database table is an inseparable basic data item. The same Column cannot have multiple values, that is, a certain attribute in the object cannot have multiple

Value or duplicate attributes are not allowed.

This is the basic concept of the first paradigm. What does it mean? For example, in a table, there is a "phone" field with the value of both the mobile phone number and the seat number?

This does not match

The first paradigm requires that "phone" be split into "Mobile Phone" and "landline", which will become a data table that conforms to the first paradigm.

Summary: fields cannot be further divided.


2NF)

The second paradigm is built on the basis of the first paradigm, that is, to meet the second paradigm, we must first meet the requirements of the second paradigm in the database table

The instance or row must be uniquely distinguished. Generally, you need to add a column to the table to store the unique identifier of each instance.

It is required that the attribute of the object fully depends on the primary key. To discuss the premise that a table operator does not conform to the second paradigm, the primary key of the table is the primary key of the combination.

The key is not in line with the second paradigm.

Summary: it cannot be partially dependent. That is to say, when a table has a composite primary key, other non-primary key fields must be completely dependent on the primary key.


3NF)

The third paradigm is to conform to the second paradigm. The third paradigm is that a data table cannot contain non-primary key fields in other data tables.

The fields in the table must be the primary key of the table.

If a table has three fields a-> B-> c, c and a are dependent on each other. This is not in line with the third paradigm, and whether a can be confirmed directly or not.

C belongs to the transfer dependency. Therefore, only B and c do not depend on any field other than a to conform to the third paradigm.

Conclusion: dependencies cannot be transmitted, that is, fields other than the primary key must depend on the primary key rather than other fields.


The above is an improper understanding of the three paradigms. Please give us more advice.

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.