The first paradigm of "database paradigm" analysis problem

Source: Internet
Author: User

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

< Span style= "color: #008080; font-size:16px; " >021101

xiaoming

male

School of Education, Department of Psychology, 1 class

100

< Span style= "color: #008080; font-size:16px; " >operator

operator

2011/10/03,09: 00

The reason that this table does not conform to 1NFis 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

Xiao ming

Man

Faculty of Education

Department of Psychology

1

100

Operator

Operator

2011/10/03

09:00

--------------------------------

1 . First paradigm (ensuring that each column remains atomic)

The first paradigm is the most basic paradigm. If all the field values in a database table are non-exploded atomic values, the database table satisfies the first paradigm.

The rational follow-up of the first paradigm needs to be determined according to the actual needs of the system. For example, some database systems need to use the "address" attribute, the "address" attribute should be directly designed as a database table field. However, if the system often accesses the "city" part of the "address" attribute, then it is not to be the "address" attribute to be re-split into provinces, cities, detailed address and other parts of storage, so that in the address of a part of the operation will be very convenient. This design satisfies the first paradigm of the database, as shown in the following table.

The user information shown in the table above follows the requirements of the first paradigm, which makes it very convenient to classify users using cities, and also improves the performance of the database.

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.

"Database Paradigm" analytic first 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.