A few words to clarify the basic paradigm of the database

First Normal Form 1NF: Attributes can no longer be split.

  • Person (ID number, name, gender, contact information) does not satisfy 1NF
  • Because the contact information includes phone number, email address, WeChat, QQ, etc.
  • Person (ID number, name, gender, phone number) satisfies 1NF

Second Normal Form 2NF: There is no partial functional dependency of non-primary attributes on the primary key.

  • The primary key of R(A, B, C, D, E) is (A, B), and there is a functional dependency { A,B → C, B → D, C → E }
  • R does not satisfy 2NF, because there is a partial functional dependency B → D
  • Use means to kill B → D and become { A, B → C, C → E } is enough

You may have noticed that C → E, E has nothing to do with the primary key, can this exist? ! The answer is that it is allowed in 2NF. 2NF is not so wide. It only cares about the functional dependencies related to the primary key.

Third Normal Form 3NF: There is no transfer function dependency of non-primary attributes on the primary key.

  • In the above example, we have got { A,B → C, C → E }
  • But { A,B → C, C → E } does not satisfy 3NF
  • Because there is A, B → C → E, that is, E has a transitive functional dependence on the primary key
  • Use means to kill C → E and become { A, B → C }, which is enough

BCNF: Objects dependent on non-primary attributes must be primary keys, and cannot be partial functional dependencies !

I personally feel that BCNF is not upgraded all the way like the one-two-three paradigm. According to the definition, in fact, BCNF only needs to be based on the first paradigm. However, you can also satisfy BCNF on the basis of the third normal form to improve the normalization of the database.

  • 2NF does not care about functional dependencies not related to the primary key
  • While BCNF cares about all functional dependencies
  • It requires that the left side of the arrow of all functional dependencies must be the primary key
  • { A,B → C, C → E } satisfies 2NF but not BCNF
  • Unless changed to { A,B → C, A,B → E }

Therefore, BCNF is more like an upgraded version of 2NF. It not only prohibits some functional dependencies, but also requires all functional dependencies to satisfy this relationship.


If there are mistakes, please correct me!

It's purely for college students to prepare for the exam!

Guess you like

Origin blog.csdn.net/m0_64140451/article/details/131050368