I understand the data paradigm!

zhaozj2021-02-16  47

The first paradigm (1NF):

If each relationship between the relationship mode R is an atom value of the atom value of the attribute value of R, the relational R is a mode of the first paradigm.

Does not satisfying the first paradigm: Relationship R (Name, Address, Phone) ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- ------------------------------------- Name Address Phone

AA Hunan Changsha 2204446 AA Hunan Changsha 8350524 -------------------------------------------------------------------------------------------------------------------------------------- ---------------------------- Description: Phone can be divided (can be divided into phone1 and phone2).

*********************************************************** *****************************************

Second paradigm (2NF):

1): Local dependencies: For dependencies W-> A (a dependent W), if there is X attribution to W, and X-> A (a dependence is dependent on x), then W-> A is local dependence; otherwise Call W-> A is completely dependent. For example: Relation mode R (Sno, CNO, Grade, TNAME, TADDR) SNO: Student number; CNO: course number; grade: score; TNAME: Teacher Name; TADDR: Teacher Address ( Sno, CNO) -> (TNAME, TADDR) (SNO, CNO is determined to TNAME and CNO) is local dependence because CNO -> (TNAME, TADDR).

2): Evai-style definition: If the relational mode R satisfies the first paradigm, and each non-primary property is completely dependent on the hockey key, R is called the second paradigm.

Does not satisfying the second paradigm: Relation mode R (Sno, CNO, Grade, TNAME, TADDR) SNO: Student JO: CNO: Course Number; grade: Score; TNAME: Teacher Name; TADDR: Teacher Address ---- -------------------------------------------------- ---------------- Sno CNO GRADE TNAME TADDR

101 001 100 Teacher Hunan Changsha .... 102 001 95 Teacher Hunan Changsha .... 103 001 98 Teacher Hunan Changsha .... 104 002 95 Li Teacher Hunan Changde .... 105 003 90 Liu Teacher Hunan Hengyang ....----------------------------------------------- ------------------------- Description: The same TNAME, TADDR three times elimination method: Decomposing Relationship mode r --------- -------------------------------------------------- ----------- R1 (SNO, CNO, GRADE)

Sno cn grade

101 001 100102 001 95103 001 98104 002 95105 003 90

R2 (CNO, TNAME, TADDR)

CNO TNAME TADDR

001 Teacher Hunan Changsha .... 002 Li Hunan Changde ... 003 Liu Teacher Hunan Hengyang ....----------------------- ----------------------------------------------- *** *********************************************************** ***************************************

Third paradigm (3NF):

1): Pass the dependencies: If x> y, y-> a, and Y does not rely on x and a subset of Y, X-> A is the conversion dependencies. (A delivery depends on x)

2): Tri-style definition: If the relational mode R is 1NF, and each non-primary property does not rely on the Hou Selection key of R, then R satisfies the third paradigm.

Does not satisfying the third paradigm: Relation mode R2 (CNO, TNAME, TADDR) is 2NF mode, if there is a CNO-> TNAME, TNAME-> Taddr in R2, then CNO-> Taddr is a transfer dependence, and not satisfied The third paradigm. ---------------------------------------------- ------------------------ CNO TNAME TADDR

001 Teacher Hunan Changsha .... 002 Li Hunan Changde .... 003 Liu Hunan Hengyang .... 004 Teacher Hunan Changsha .... 005 Teacher Hunan Changsha ....----- -------------------------------------------------- --------------- Description: Teacher Zhang has opened 3 courses, and there were 3 yuan groups, and the teacher address was repeated 3 times. Elimination method: Decomposition relational mode R2-- -------------------------------------------------- ---------------- R3 (CNO, TNAME)

CNO TNAME

001 Mr. 002 Mr. Liu 004 Teacher 005 Teacher

R4 (TNAME, TADDR)

TName Taddr

Teacher Zhang Hunan Changsha .... Li Teacher Hunan Changde .... Liu Teacher Hunan Hengyang ....------------------------------------------------------------------------------------------------------------------------------------- --------------------------------------------

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

New Post(0)