Several design paradigms for relational databases are introduced:
First paradigm: Ensure the atomicity of each column (emphasizing the atomicity of the column, that is, the column cannot be divided into several other columns). If each column (or each attribute) is the smallest data unit (also known as the smallest atomic unit) that is not re-divided, the first normal form is satisfied. Example: Customer table (name, number, address 、......) Where the "address" column can also be subdivided into countries, provinces, municipalities, districts and so on. The second paradigm: On the basis of the first paradigm, the goal is to ensure that each column in the table is related to the primary key (one is that the table must have a primary key; the other is that columns that are not contained in the primary key must depend entirely on the primary key, not the primary key). If a relationship satisfies the first normal form, and a column other than the primary key, which depends on the primary key, satisfies the second normal. For example: the order form (order number, product number, order date, Price 、......),"order number" as the primary key, "product number" and primary key column do not have a direct relationship, that is, the "Product number" column does not depend on the primary key column, you should delete the column. The third paradigm: on the basis of the second paradigm, the goal is to ensure that each column is directly related to the primary key column, rather than indirectly (another non-primary key column must be directly dependent on the primary key and cannot have a transitive dependency). If a relationship satisfies the second normal form and the columns other than the primary key are not dependent on the primary key column, the third normal form is satisfied. In order to understand the third paradigm, it is necessary to define transitive dependencies according to one of Armstrong km. Suppose that A, B, and C are the three properties of the relationship R, and if a-〉b and b-〉c, from these function dependencies, you can derive a-〉c, as described above,
DependencyA-〉c is a transitive dependency. For example: order form (order number, date of purchase, customer number, customer name, ...), first look at the table is not a problem, to meet the second paradigm, each column and the primary key column "order number" related, and then you will find "Customer name" and "Customer
Number "related," customer number "and" Order Number "are also related, finally pass the dependency," Customer name "and" Order number "related. In order to satisfy the third paradigm, the "Customer name" column should be removed and placed in the Customer table.
The three main paradigms of MySQL