Database design Paradigm

Source: Internet
Author: User

What is a paradigm: in short, database design has a great relationship to the data storage performance, as well as the developer's ability to manipulate the data. Therefore, the establishment of a scientific, normative database is required to meet some specifications to optimize the data storage method. In a relational database, these specifications can be called paradigms.

What are the three main paradigms:

First Paradigm: each column of a database table is an indivisible atomic data item , the R is satisfied with the first paradigm, and the précis-writers is 1NF.

Second paradigm: requires that the attributes of an entity depend entirely on the primary key. In short, the second paradigm is that on the basis of the first paradigm the property is completely dependent on the primary key.

The third paradigm: On a 1NF basis, any non-primary attribute is not dependent on other non-primary attributes (eliminating transitive dependencies on a 2NF basis).

Note: A relationship is essentially a two-dimensional table in which each row is a tuple, and each column is an attribute.

Understanding the three main paradigms

First Paradigm

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

2. The properties of the two columns are similar or similar, and the same columns are merged as possible to ensure that no redundant data is generated.

If the demand knows the province and classifies it, then it is clear that the first table is not easy to meet the requirements and does not conform to the first paradigm.

It is clear that the first table structure not only satisfies the requirements of a sufficient number of items, but also creates redundancy in the case of an item. Also does not conform to the first paradigm.

Second Paradigm

The data for each row can only be related to one of the columns, that is, a single row of data does one thing. As long as there is data duplication in the data column, you need to split the table.

A person to order a few rooms at the same time, will come out an order number of data, this way contacts are duplicated, resulting in data redundancy. We should tear him apart.

This enables a single piece of data to do one thing without complex relational logic. Update maintenance of table data is also easier to operate.

Third Paradigm

Data cannot have a transitive relationship, that is, no attribute has a direct relationship with the primary key, not an indirect one. Like: A-->b-->c attributes have such relationships that do not conform to the third paradigm.

such as Student table (school number, name, age, gender, institution, institution address, college phone)

Such a table structure, there is the above relationship. Study number------(university address, college phone)

Such a table structure, we should take apart, as follows.

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

At last:

The three paradigms are only the basic concept of general design database, and can build a database with smaller redundancy and reasonable structure. If there is a special case, of course, to special treatment, database design is most important to look at requirements and performance, requirements > Performance > table structure. So we can't blindly pursue the paradigm to build a database.

Database design 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.