Three paradigms of Database Design: Database paradigm
1NF)
◇ Each column must contain only one value (also known as the atomicity or non-severability of column values ). For example, to store user addresses, a column cannot store information such as country, province, city, and street at the same time.
◇ All tables cannot have duplicate columns with related data. For example, a product image cannot use one column for image 1, Image 2 with one column, and image 3 with one column ......, if a table has duplicate similar columns, the relational model (one-to-one, one-to-many) is used to convert these columns into separate tables.
The first paradigm is the horizontal analysis table, which ensures the uniqueness of the value of the horizontal column and avoids repeated similar data.
2NF)
◇ A column must be unique in multiple rows.Non-primary key valueThe duplicate non-primary key value must be the primary key value of another table. Here we are confused about the time field. In fact, MySQL supports a very good date, and the probability of identical operations within the same second is extremely low.
◇ Each non-primary key in the table depends on the primary key of the table.
The second paradigm is the vertical analysis table to ensure that the values of the vertical columns do not contain duplicate non-primary key values. View the relationship between tables. If there is a many-to-many relationship, you need to split the table and create a new joined table. The primary key of one table is usually the foreign key of another table.
3NF)
◇ A single column in a table is independent, that is, modifying the values of a column does not need to modify the values of another column. One column cannot be a subset of another column, for example, if a-> B-> c and c are attributes of B, bc cannot appear in a table at the same time. However, columns and columns are mutually dependent.
Database design allows personal interests and interpretations, but the most important requirement is not to clearly violate the paradigm. Any design that violates the paradigm will have some problems in the future. Standardization is to weigh data integrity and scalability between simplicity and speed. practice and experience will allow us to master the best data modeling methods and follow the paradigm as much as possible.