- Each column property is an indivisible property value, ensuring the atomicity of each column
Student Number name Gender contact
20080901 Three men Email:[email protected],phone:88886666
20080902 li si female email:[email protected],phone:66668888
The above table does not conform to the first paradigm: the Contact field can be re-divided, so the change to correct is:
Student number name Sex email phone
20080901 three men [email protected] 88886666
20080902 li si female [email protected] 66668888
- Each non-primary property is determined by the entire primary key function and cannot be determined by a part of the primary key, which is to eliminate partial dependencies. The second paradigm can reduce insert exceptions, delete exceptions, and modify exceptions
For example (students choose a timetable):
Student curriculum teacher teacher Title textbook class time
John Doe Spring Zhang teacher Java lecturer "Spring in the" 301 08:00
Zhang San struts yang teacher Java lecturer "Struts in Action" 302 13:30
Here (students, courses) can determine teacher, teacher title, textbook, Classroom and class time, so you can put (students, courses) as the primary key. However, the textbook is not entirely dependent on (students, courses), only take out the course to determine the teaching material, because a course, must have designated a teaching material. This is called incomplete dependency, or partial dependency. In this case, the second paradigm is not satisfied.
After the change, select the timetable:
Student Curriculum teacher Teacher Title class time
John Doe Spring Zhang teacher Java Lecturer 301 08:00
Zhang San Struts yang teacher Java Lecturer 302 13:30
Curriculum:
Course Materials
Spring "Spring in the Bible"
Struts in Action
- Data cannot have a transitive relationship, that is, no attribute is directly related to the primary key, not an indirect relationship.
such as Student table (school number, name, age, gender, institution, institution address, college phone)
Such a table structure, there is the above relationship. Study number------(university address, college phone)
Such a table structure, we should take apart, as follows.
(Student number, name, age, gender, institution)--(institution, institution address, school phone)