The third paradigm of database design

Source: Internet
Author: User
Tags one table

First, the database design paradigm and its significance and shortcomings

The design paradigm of database is the specification that database design needs to meet, the normalization of database is the way to optimize the structure of table and how to organize the data into the table, so that the data is clearer and more concise. In practice, it is common to divide a database into two or more tables and define relationships between tables for data isolation, adding, deleting, and modifying a field only in one table, and then passing through the defined relationships to the remaining tables in the database (and the meaning of layered thinking is very much the same). This allows us to eliminate many of the opportunities for error or junk data and to reduce the amount of work necessary to update the information.


At present, there are six main paradigms: the first paradigm, the second paradigm, the third paradigm, the BC Paradigm, the fourth normal form and the fifth paradigm. Meet the minimum requirements called the first normal form, referred to as 1NF. On the basis of the first paradigm to further meet some requirements for the second paradigm, referred to as 2NF. The rest and so forth


Things tend to be multi-faceted, and the design paradigm also brings some trouble: it's difficult to operate because you need to contact multiple tables to get the data you need, and the higher the paradigm, the worse it will be. So the use of how high the paradigm needs to weigh the pros and cons, generally in the project, the use of the third paradigm is sufficient, good performance and easy to manage data.

Second, let us give an example of the three paradigms of database design

Description: Examples of "school computer room charge system" of the "Student Information table", "students up and down the record table" part of the field

1, the first paradigm 1NF

Definition: A field in a database table is a single attribute and cannot be divided.

Simply put, each attribute is an atomic term, indivisible.

1NF is the minimum condition that a relational pattern should have, and if the database design does not meet the first paradigm, it is not called a relational database. That is to say, as long as the relational database, it must satisfy the first normal form.

Let's start with a list of non-conforming 1NF 1-1

Cardno

Studentno

Studentname

Sex

Department

Cardcash

Userid

UserLevel

Time

001

021101

Xiao ming

Man

School of Education, Department of psychology, Class 1

100

Operator

Operator

2011/10/03,09:00

This table does not conform to 1NF because the department and Time fields can be re-divided, so you should change to table 1-2:

Cardno

Studentno

Studentname

Sex

Academy

Major

Class

Cardcash

UserID

UserLevel

Date

Time

001

021101

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.