"High Performance Database" a

Source: Internet
Author: User

The first lecture: Paradigm Design

First of all, I said, the database is designed, then the development. Developing in accordance with the third paradigm will allow you to ascend to a new realm!

Noun Explanation: the third normal form

First paradigm: A table that does not contain duplicate columns is attributed to the first normal form.

Second paradigm: If a table is attributed to the first normal form and contains only columns that depend on the primary key, then the second paradigm.

Third paradigm: If a table is attributed to the second normal form and contains only those columns that are not transitive and dependent on the primary key, then the third paradigm.

Chair3 Dictation Simple Explanation:

First paradigm: Tables that do not design duplicate fields

Like what:

Create Table tb1 (
fd1 varchar(20), --用来存放电话
fd2 varchar(20), --用来存放电话
fd3 int --其他
)

Then FD1,FD2 violates the first paradigm

Second paradigm:

Second Normal: Do not design a table without a primary key, or without a unique index

For example: If a table has the same data, it must be a violation of the second normal form undoubtedly.

The third normal form: can subdivide each field subdivided.

For example: A table, originally designed to:

Create TAble Clothes(
ClothesID int primary key,--ID
Color varchar(10), --颜色
Description varchar(20) --描述
)

So color violates the third paradigm.

So the third paradigm should be designed like this

Create TAble Clothes(
ClothesID int primary key,--ID
ColorID Int, --颜色ID
Description varchar(20) --描述
)

Create Table Color(
ColorID int primary key,
Color varchar(20)
)

Color as the primary table, clothes as a child table, the two are interconnected with Colorid.

The advantages of three paradigm design: Reduce data redundancy, improve system maintainability and improve system scalability.

The disadvantage of the three-paradigm design is that it can degrade the performance of the database. (Xi hee, but very few, we rest assured)

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.