I. First paradigm

1NF is the ** atomicity ** of attributes, which requires that attributes have atomicity and cannot be decomposed again. Table: Field 1, Field 2(Field 2.1, field 2.2), Field 3…… For students (student ID, name, gender, date of birth), if the last column is considered to be subdivided into (year of birth, month of birth, date of birth), it is not a normal form, otherwise it is;

Second normal form

2NF is ** uniqueness of records, requiring records to have a unique identity, that is, entity uniqueness, that is, there is no partial dependence; Table: Student ID, course ID, name, credit; This table clearly illustrates two transactions: student information, course information; Since non-primary key fields must depend on primary keys, credit depends on course number **, name depends on student number, so it does not conform to the binary normal form. There may be problems:

  • Data redundancy:, each record contains the same information;
  • Delete exception:Delete all student scores, delete all course information;
  • Insert exception:Students do not choose courses, can not be recorded into the database;
  • Update exception:Adjust course credits, all lines adjusted.

Correct Practice: Student(Student id, name); Courses: Course number, credits; StudentCourse(student number, course number, grade) 10 Years as an Architect leading You to Architecture – The Road to Growth (Interview questions included)

The most detailed and complete PHP interview questions (with answers)

zhuanlan.zhihu.com] (zhuanlan.zhihu.com/p/341488974)

Click to communicate with me about the penguin colony. Third normal Form 3NF is the perfect redundancy of fields, which requires that no field can be derived from other fields. It requires that fields have no redundancy, that is, there is no transitive dependence. Table: Student ID, name, age, College name, College phone number because there is a dependency transfer **: (Student ID)→(Student)→(college)→(College phone number). There may be problems:

  • Data redundancy:There are repeated values;
  • Update exception:Duplicate redundant information exists. You need to modify multiple records at the same time. Otherwise, duplicate information may occurInconsistent data.

Students: (student ID, name, age, school); College :(college, telephone). Thank you all for supporting me all the time. This is my 1000 fans bonus

10 years of architects share advanced PHP architecture information to help everyone achieve 30K

zhuanlan.zhihu.com] (zhuanlan.zhihu.com/p/340304217)

Click to communicate with me about the penguin colony. In general, a database only needs to satisfy the third normal form (3NF). No redundant database design can do that. However, a database without redundancy is not necessarily the best database, and sometimes in order to improve the efficiency of operation, it is necessary to lower the paradigm standards and retain redundant data appropriately. The specific approach is to follow the third normal form in the conceptual data model design, and reduce the standard of the normal form to the physical data model design. Reducing the normal form is to increase the fields, allowing redundancy, and achieving the purpose of exchanging space for time. [example] : There is a basic table for goods, and the existence of the value field indicates that the design of the table does not meet the third normal form, because the value can be obtained by multiplying unit price by quantity, indicating that the value field is redundant. However, adding the “amount” of the redundant field can improve the speed of the query statistics, which is the practice of space for time. In Rose 2002, there were two types of specified columns: data columns and computed columns. Columns such as “amount” are called “calculation columns”, while columns such as “unit price” and “quantity” are called “data columns”. 5. Advantages and disadvantages of formal design and anti-formal design

Disadvantages:

5.2 Advantages of anti-formalization:

Disadvantages:

2000 Interview questions (including answers)

* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *

zhuanlan.zhihu.com] (zhuanlan.zhihu.com/p/340637391)

Click to communicate with me about the penguin colony. Like my article to follow me, continue to update….. I hope the above content can help you. Many PHPer will encounter some problems and bottlenecks when they are advanced, and they have no sense of direction when writing too many business codes. I have sorted out some information, including but not limited to: Distributed architecture, high scalability, high performance, high concurrency, server performance tuning, TP6, Laravel, YII2, Redis, Swoole, Swoft, Kafka, Mysql optimization, shell script, Docker, micro services, Nginx and many other knowledge points can be shared free of charge, need to click into the code: nuggets.