1 paradigm: Each field in the table is atomic, and the fields in the table cannot be split again.
Such as: Instructor's name (p), Gender, Class (P), classroom, substitute time (days), substitute time period (start-end) does not meet 1NF, the substitute time period needs to split the solution: split the substitute period into start and end
Instructor's list: Instructor name (p), Gender, Class (P), classroom, substitute time (days), start time, end time
2 Normal form: the non-primary key fields in the table are all dependent on the primary key field.
In the data table design process, if there is a composite primary key (multi-character Chini), and the table has a field is not determined by the entire primary key, but the primary key to rely on a field (the primary key part); There is a part of the field dependent on the primary key problem, called partial dependency, the second paradigm is to solve partial dependence. Instructor's list: Instructor name (p), Gender, Class (P), classroom, substitute time (days), start time, end time above table: Because the instructor has no way to act as a separate primary key, you need to combine class to be the primary key (composite primary key) substitute time, Both the start and end fields are determined by the current substitute primary key (class and Class), but the gender does not depend on the class, and the classroom does not rely on the instructor, the gender only depends on the instructor, the classroom only depends on the class, the gender and the classroom depends on the primary key part, partly dependent, does not conform to 2NF. Solution 1: You can separate the gender and the instructor into a table, and the class and classroom are also separate Tables Solution 2: Ungroup primary key, using logical primary key
3 Paradigm: direct dependence. The fields in the table all depend on the primary field and cannot be indirectly dependent on the primary field by relying on other fields. That is, to eliminate dependency passing.
Instructor's Substitute table: ID (P), instructor name, gender, class, classroom, substitute time (days), start time, end time above design method: Gender dependent instructor exists, instructor relies on primary key; classroom dependent class, class dependent primary key solution: A field that has transitive dependencies, and the dependent fields themselves are taken out separately, form a separate table, and then add in the primary key of the corresponding entity table when the corresponding information is needed. Instructor's substitute table: ID (p), instructor ID, class ID, substitute time (days), start time, End time instructor table: ID (p), instructor name, gender (ID equivalent to Instructor) class table: ID (P), class, classroom (ID equivalent to class)
Part of this article goes from http://www.myexception.cn/mysql/2072142.html Thank you to the author
Three Paradigms of database