Mysql's three-paradigm design

When using Mysql database for data table design, what is anti-paradigm design? What are some common anti-paradigm designs?

1. Three-paradigm design of Mysql data table

The latter paradigm is built on the basis of satisfying the previous one. 

1NF : No duplicate column . Each column in a table is an indivisible basic data item. A database that does not satisfy 1NF is not a relational database.
    For example: contacts Table (name, phone), if a contact has home phone and company phone, it does not conform to 1NF and should be split into (name, home phone, company phone).
    Atomicity, the data cannot be further divided
2NF : Attributes are completely dependent on the primary key . There cannot exist attributes that only depend on a part of the key. There is no redundancy in the data .  For example: course selection relationship (student number, course name, grades, credits), combined keywords (student number, course name) as the primary key .It does not satisfy 2NF,
   
    Because there is a decision relationship: course name -> credits, there is a situation where some fields in the composite primary key determine non-primary attributes. It will lead to data redundancy, update/insert/delete exceptions.
 :Attributes are not transitively dependent on other non-primary attributes. Non-primary key columns must directly depend on the primary key, not transitively.
        That is, it cannot be: non-primary key A depends on non-primary key B, and non-primary key B depends on primary key.
        
    For example: student table (student ID, name, college ID, college name), student ID is the primary key, name, college ID, college name are completely dependent on the student ID,
            2NF is satisfied, but 3NF is not satisfied, because the college name directly depends on the college number, which depends on the primary key through transit.


Guess you like

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