Database pattern

zhaozj2021-02-16  98

1NF: Each field in the table can only contain a data class, each saved in one place. 1NF is also known as atomic data requirements, that is, each field is integrated, like atom. 1NF tells us not to put multiple data in a field. Situing 1NF: 1. Pile related data in a field. If the supplier field is placed in the supplier and put the supplier address. It should be broken down into multiple fields. 2, repeat fields. If there are these fields in the order table, the quantity 1, the product number 2, the quantity 2, the product number 3, the number 3, and the like. 2NF: On the basis of 1nf, there is only one entity data. There is no nested entity. Or each non-key list relies on the full key column, not completely relevant, is fully related. 3NF: On the basis of 2NF, all non-key collections are directly dependent on the primary key column, not other non-key listed, such as calculating fields. Or each table contains only one thing, do not include multiple facts. BDNF: Each non-key list relies on the entire primary keyword, not some primary keywords. (3NF is the first half of this sentence, BDNF is said to be the second half of this sentence) 4nf: When there is a correlation between a set of related entities, this relationship is exactly, not implies With a table. If there is a certain relationship, this relationship should be expressed in a table. 5nf: Decomposing the two tables will lose information, but can be broken down into multiple tables without losing information. If you do not meet the previous paradigms, a table is decomposed into two tables.

The final result of the normalization is: When a data in the table is updated, only one line in the table is implicit, and cannot affect multi-line, and only one field in this line cannot affect other in this line. Field. When a atomic data needs to change, modify multiple lines in multiple tables, multiple lines in a table, indicate that there is no normalization.

转载请注明原文地址:https://www.9cbs.com/read-12110.html

New Post(0)