Interesting talk about database paradigm

Today, I saw a very good metaphor for the database three paradigms in the circle of friends. I feel that it is quite right. I hereby share it:

First of all, the main function of the database's three paradigms is to reduce the redundancy of the database. The higher the paradigm level, the less redundant the database.

The first normal form is that each column of the database table is an indivisible atomic data item.

The second normal form is based on the first normal form, which is based on the attribute-based primary key.

The third normal form is that any non-primary attribute cannot depend on other non-primary attributes (elimination of transitive dependencies on the basis of 2NF). For example, there is an employee table and a department table. In addition to the primary key of the department table, the employee table cannot contain other non-primary attributes of the department table (department name, department description, etc.)

Bath-Codd Normal Form (BCNF): Each attribute does not pass a candidate key that depends on R, then R is called a BCNF schema. Assume that the warehouse management relationship table (warehouse number, storage item number, administrator number, quantity) satisfies that one administrator only works in one warehouse; one warehouse can store multiple items. If a warehouse stores multiple items, the same warehouse number and administrator number will be recorded repeatedly, so the administrator number is redundant and does not conform to the BCNF paradigm. It is best to have two tables, (warehouse number, administrator number) And the warehouse table (warehouse number, storage item number, quantity), in this way, it conforms to the BCNF paradigm.

In the fourth normal form, R is a relational model and D is a multi-valued dependency set on R. If there is any multi-valued dependency X->Y in D, X must be a superkey of R, then R is said to be a mode in fourth normal form. Employee table (employee number, employee child name, employee elective course), in this table, the same employee may have multiple employee child names, and the same employee may also have multiple employee elective courses, that is, there are With multi-valued facts, it does not conform to the fourth normal form. If you want to conform to the fourth normal form, you only need to divide the above table into two tables, so that they have only one multi-valued fact, such as employee table 1 (employee number, employee's child name), employee table 2 (employee number, employee elective course) , both tables have only one multi-valued fact, so they are in fourth normal form.

 

A student doing AI concluded:

The first paradigm is that primitive people record natural phenomena, and drill wood to make fire to repeat it next time; the second paradigm is theoretical science, which summarizes the laws, and future generations know the laws; the third paradigm is computational deduction, which is more complicated, such as nuclear Experiments, weather forecasts, etc.; Fourth Paradigm is committed to letting machines see Newtonian things, see data, and summarize laws.

 

 

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325339688&siteId=291194637
Recommended