The book said a lot, summed up 3 words:
1NF: The field is not divided;
2NF: Primary key, non primary key field dependent primary key;
3NF: Non-primary key fields cannot be dependent on each other;
Explain:
1NF: Atomic field can not be divided, otherwise it is not a relational database;
2NF: Uniqueness A table only shows one thing;
3NF: Each column has a direct relationship with the primary key, there is no transmission dependency;
Examples that do not conform to the first paradigm (no such table is created in a relational database):
Table: Field 1, Field 2 (Field 2.1, Field 2.2), Field 3 ...
The problem: Because the design does not have such a table, so there is no problem;
Examples that do not conform to the second paradigm:
Table: School number, name, age, course name, score, credits;
This table clearly illustrates two transactions: Student information, course information;
There is a problem:
Data redundancy, each record contains the same information;
Delete exception: Delete all student scores, all the course information deleted;
Insert exception: Students did not select classes, can not be recorded in the database;
Update Exception: Adjust course credits, all lines are adjusted.
Correction:
Student: Student (school number, name, age);
Course: Course (course name, credits);
Elective relationship: Selectcourse (School number, course name, grade).
Satisfying the 2nd paradigm only eliminates the insertion exception.
Examples that do not conform to the third paradigm:
School number, name, age, Institute, college contact Telephone, the key word for a single key word "school number";
There is a reliance on delivery: (school number) → (college) → (Institute location, college phone)
There is a problem:
Data redundancy: there are duplicate values;
Update Exception: Duplicate redundancy information, modify multiple records at the same time, otherwise there will be inconsistent data
Remove exception
Correction:
Student: (School number, name, age, college);
College: (College, location, telephone).
Author: sunxing007