Elaborate on the three paradigms of database
1NF: fields cannot be divided
Example:
Table 1,
User ID name area 1 Xiaoming Guangzhou City, Guangdong Province 2 Xiaohong Nanjing City, Jiangsu Province can be divided into: province and city
As follows:
Table 2,
User ID name province city 1 Xiaoming Guangdong Province Guangzhou City 2 Xiaohong Nanjing City, Jiangsu Province Table 1 does not conform to the first paradigm, Table 2 accords with
2NF: there is a primary key, and non-primary key fields depend on the primary key
Student table (where the student number is the primary key):
Class 001 Xiaojiang Grade 6 Class 1 it is obvious that the class does not depend on people, so this table does not conform to the second paradigm.
The relationship between the student table and the class is in line with the second paradigm when put into a relationship table.
3NF: non-primary key fields cannot depend on each other
Course schedule (course number is the primary key)
Course number, course name, student number, name 1 Chinese 001 Xiaojiang
Among them, the name Xiao Jiang depends on the serial number 001, so it does not satisfy the third paradigm.