The book said a lot, it boils down to 3 words:
1NF: field is not divided;
2NF: Primary key, non-primary key field depends on primary key;
3NF: Non-primary key fields cannot depend on each other;
Explanation:
1NF: Atomic field can not be re-divided, otherwise it is not a relational database;
2NF: Uniqueness A table shows only one thing;
3NF: Each column is directly related to the primary key, there is no transitive dependency;
Examples that do not conform to the first paradigm (create a table 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, grade, credit;
This table clearly illustrates two transactions: Student information, course information;
A problem exists:
Data redundancy, each record contains the same information;
Delete exception: Delete all student scores, the course information is completely deleted;
Insert exception: The student does not choose the class, cannot record into the database;
Update Exception: Adjust course credits and all lines are adjusted.
Correction:
Student: Student (school number, name, age);
Course: Course (course name, credits);
Elective relationship: Selectcourse (School number, course name, score).
Satisfying the 2nd paradigm only eliminates the insertion exception.
Examples that do not conform to the third paradigm:
School number, name, age, school, college contact number, key word for a single keyword "study number";
Presence Dependent Delivery: (school number) → (school) → (college location, college phone)
A problem exists:
Data redundancy: there are duplicate values;
Update exception: Duplicate redundant information, modify the need to modify multiple records at the same time, otherwise there will be inconsistent data situation
Delete exception
Correction:
Student: (School number, name, age, school);
College: (College, location, telephone)
Database of three-type popular analysis (reproduced)