Three major database design paradigms and three database paradigms

Source: Internet
Author: User

Three major database design paradigms and three database paradigms
Database design paradigm

What is paradigm: Simply put, database design has a great relationship with data storage performance and data operations by developers. Therefore, scientific and standardized databases must meet

Standardized to optimize data storage. In relational databases, these specifications can be called paradigms.

What are the three major paradigms:

First paradigm: When all the attributes of the relational model R cannot be broken down into more basic data units, R is called to meet the first paradigm and is abbreviated as 1NF. Satisfying the first paradigm is the lowest requirement for standardizing the relationship model.

Otherwise, many basic operations cannot be implemented in this relational mode.

Second paradigm: If the relational model R satisfies the first paradigm, and all the non-primary attributes of R are completely dependent on each candidate key attribute of R, R satisfies the second paradigm and is abbreviated as 2NF.

Third paradigm: Set R to a relational model that meets the first paradigm condition, and X to any property set of R. If X is not transmitted, it depends on any candidate keyword of R, R satisfies the third paradigm and is abbreviated as 3NF.

Note:A link is essentially a two-dimensional table. Each row is a tuples and each column is an attribute.

Understanding three paradigms

First paradigm

1. Each column attribute is an attribute value that cannot be further divided, ensuring the atomicity of each column

 

2. If the two columns have similar or similar attributes, try to merge columns with the same attributes to ensure that no redundant data is generated.

 

 

 

If you need to know the city of the province and classify it, it is clear that the first table is not easy to meet the requirements and does not conform to the first paradigm.

 

 

 

Obviously, the first table structure not only does not meet the requirements of enough items, but also generates redundancy when there are few items. It also does not conform to the first paradigm.

 

Second paradigm

 

The data of each row can only be related to one column, that is, only one row of data is required. As long as the data in the data column is duplicated, the table must be split.

 

 

When a person subscribes to several rooms at the same time, multiple pieces of data will be generated with an order number. In this way, all contacts are duplicated, resulting in data redundancy. We should split it apart.

 

 

 

 

 

In this way, a piece of data is implemented, and complex relational logic is not involved. At the same time, it is easier to update and maintain table data.

 

Third paradigm

Data cannot be transmitted, that is, no attribute is directly related to the primary key rather than indirectly. For example, a --> B --> c attributes do not conform to the third paradigm.

For example, Student table (Student ID, name, age, gender, school, school address, school phone number)

Such a table structure has the preceding relationship. Student ID --> school --> (School Address, school phone number)

The following table structure should be split.

(Student ID, name, age, gender, school) -- (school, school address, school phone number)

 

Finally:

The three major paradigms are only the basic concepts of general database design, and can be used to build databases with low redundancy and reasonable structure. If there are special cases, of course we should take special measures. The most important thing in database design is to look at the requirements and performance, requirements> performance> table structure. Therefore, we cannot blindly pursue the paradigm to establish databases.

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.