Detailed explanation of database principle, save your final exam four parts [3]: database paradigm

Detailed explanation of the database principle, save your final exam four parts [3]: Chapter 6

Chapter Six

1. Relationship model

① The composition of the relationship model

R(U,D,DOM,F)

  • R-Relationship name
  • U-a set of attributes
  • DOM-attribute to domain mapping
  • A set of data dependencies of F-attribute group U

② Processing in this chapter

R<U,F>

If and only if a relation r on U satisfies F, r is called a relation of the relational pattern

Two, functional dependence (FD)

① Function dependency definition

If the value of attribute or attribute group X is determined, the value of attribute Y can be determined, then it is called

  • Y function depends on X or X function to determine Y
  • Has made X→Y
[External link image transfer failed. The source site may have an anti-leech link mechanism. It is recommended to save the image and upload it directly (img-iMcwycBr-1622811648575) (C:\Users\Leizi of the official second\Desktop\Future village chief\image -20210604113256063.png)]
② Ordinary dependence and non-trivial dependence
[External link image transfer failed. The source site may have an anti-leech link mechanism. It is recommended to save the image and upload it directly (img-Xb2YqKaV-1622811648576) (C:\Users\Leizi of the official second\Desktop\Future village chief\image -20210604114013939.png)]
[External link image transfer failed. The source site may have an anti-leech link mechanism. It is recommended to save the image and upload it directly (img-L3T30Da5-1622811648579) (C:\Users\Leizi of the official second\Desktop\Future village chief\image -20210604114104606.png)]
③ Complete functional dependence, partial functional dependence and transitive dependence
  • In a table, if X → Y, and for any proper subset of X (if the attribute group X contains more than one attribute), X '→ Y does not hold, then we say that Y is fully functionally dependent on X:
img
  • If the Y function depends on X, but at the same time Y is not fully functionally dependent on X, then we say that part of the function of Y depends on X, denoted as:
img
④ Transitive dependence
[External link image transfer failed. The source site may have an anti-leech link mechanism. It is recommended to save the image and upload it directly (img-tdF0KeVr-1622811648581) (C:\Users\Leizi of the official second\Desktop\Future village chief\image -20210604114431009.png)]

Three, 1NF paradigm

Each component must be an inseparable data item , denoted as R ∈ 1NF

Examples of errors :

[External link image transfer failed. The source site may have an anti-leech link mechanism. It is recommended to save the image and upload it directly (img-ECVgnTDx-1622811648582) (C:\Users\Leizi of the official second\Desktop\Future village chief\image -20210604114537914.png)]
[External link image transfer failed. The source site may have an anti-leech link mechanism. It is recommended to save the image and upload it directly (img-qrSZ44GJ-1622811648582) (C:\Users\Leizi of the official second\Desktop\Future village chief\image -20210604205306164.png)]

Four, 2NF paradigm

There is no partial dependence on the code of non-primary attributes

① Examples of errors
[External link image transfer failed. The source site may have a hotlink prevention mechanism. It is recommended to save the image and upload it directly (img-6HXqoW3o-1622811648583) (C:\Users\Leizi of the official second\Desktop\Future village chief\image -20210604115200562.png)]
② Judgment method
  • Find all the codes in the data table
  • According to the obtained code, find out all the main attributes and non-primary attributes
  • Check whether the partial dependency of the non-primary attribute pairing code exists
③ Modification method
[External link image transfer failed. The source site may have a hotlink prevention mechanism. It is recommended to save the image and upload it directly (img-TAtGO0nB-1622811648584) (C:\Users\Leizi of the official second\Desktop\Future village chief\image -20210604115332287.png)]
② The improvement benefits of the second paradigm
[External link image transfer failed. The source site may have an anti-leech link mechanism. It is recommended to save the image and upload it directly (img-IHBCOOJO-1622811648584) (C:\Users\Leizi of the official second\Desktop\Future village chief\image -20210604120132120.png)]

Five, 3NF paradigm

There is no transfer function dependence of non-primary attributes on the code

① Judgment method
  • Find all the codes in the data table
  • According to the obtained code, find out all the main attributes and non-primary attributes
  • Check whether the transitive dependency of non-primary attributes on the code exists
[External link image transfer failed. The source site may have an anti-leech link mechanism. It is recommended to save the image and upload it directly (img-9Gr502Nk-1622811648585) (C:\Users\Leizi of the official second\Desktop\Future village chief\image -20210604115800105.png)]
② Standardization process
[External link image transfer failed. The source site may have an anti-leech link mechanism. It is recommended to save the image and upload it directly (img-rOUxwI2d-1622811648585) (C:\Users\Leizi of the official second\Desktop\Future village chief\image -20210604115833920.png)]
③ Two proofs
[External link image transfer failed. The source site may have an anti-leech link mechanism. It is recommended to save the image and upload it directly (img-ZfT5CWAi-1622811648586) (C:\Users\Leizi of the official second\Desktop\Future village chief\image -20210604115634001.png)]
[External link image transfer failed. The source site may have an anti-leech link mechanism. It is recommended to save the image and upload it directly (img-h7GTghQQ-1622811648587) (C:\Users\Leizi of the official second\Desktop\Future village chief\image -20210604115652647.png)]
④ The advantages and disadvantages of the third normal form
[External link image transfer failed. The source site may have an anti-leech link mechanism. It is recommended to save the image and upload it directly (img-JSwrUqFt-1622811648587) (C:\Users\Leizi of the official second\Desktop\Future village chief\image -20210604120055097.png)]

Six, BCNF paradigm

There is no partial dependence and transitive dependence on the code of the main attribute

[External link image transfer failed. The source site may have an anti-leech link mechanism. It is recommended to save the image and upload it directly (img-jkHtb6gn-1622811648588) (C:\Users\Leizi of the official second\Desktop\Future village chief\image -20210604205244638.png)]

Seven, comprehensive exercises

[External link image transfer failed. The source site may have an anti-leech link mechanism. It is recommended to save the image and upload it directly (img-LBkCrvbo-1622811648589) (C:\Users\Leizi of the official second\Desktop\Future village chief\image -20210604205345778.png)]
[External link image transfer failed. The source site may have an anti-leech link mechanism. It is recommended to save the image and upload it directly (img-p4Xv8EBz-1622811648589) (C:\Users\Leizi of the official second\Desktop\Future village chief\image -20210604205425509.png)]
[External link image transfer failed. The source site may have an anti-leech link mechanism. It is recommended to save the image and upload it directly (img-wDjMyZnj-1622811648590) (C:\Users\Leizi of the official second\Desktop\Future village chief\image -20210604205432097.png)]
[External link image transfer failed. The source site may have an anti-leech link mechanism. It is recommended to save the image and upload it directly (img-x7xtFNMI-1622811648591) (C:\Users\Leizi of the official second\Desktop\Future village chief\image -20210604205442362.png)]
[External link image transfer failed. The source site may have a hotlink prevention mechanism. It is recommended to save the image and upload it directly (img-bMgPCo6A-1622811648591) (C:\Users\Leizi of the official second\Desktop\Future village chief\image -20210604205451310.png)]
[External link image transfer failed. The source site may have an anti-leech link mechanism. It is recommended to save the image and upload it directly (img-tNa6KaOw-1622811648592) (C:\Users\Leizi of the official second\Desktop\Future village chief\image -20210604205459450.png)]
[External link image transfer failed. The source site may have an anti-leeching mechanism. It is recommended to save the image and upload it directly (img-zdxC3PCm-1622811648592) (C:\Users\Leizi of the official second\Desktop\Future village chief\image -20210604205506934.png)]
[External link image transfer failed. The source site may have an anti-leech link mechanism. It is recommended to save the image and upload it directly (img-FwHFpBh1-1622811648593) (C:\Users\Leizi of the official second\Desktop\Future village chief\image -20210604205516935.png)]
[External link image transfer failed. The source site may have an anti-leech link mechanism. It is recommended to save the image and upload it directly (img-XOqqFVJf-1622811648594) (C:\Users\Leizi of the official second\Desktop\Future village chief\image -20210604205527570.png)]
[External link image transfer failed. The source site may have an anti-leech link mechanism. It is recommended to save the image and upload it directly (img-2uFPMg9j-1622811648595) (C:\Users\Leizi of the official second\Desktop\Future village chief\image -20210604205538332.png)]
[External link image transfer failed. The source site may have an anti-leech link mechanism. It is recommended to save the image and upload it directly (img-1rcF830Q-1622811648596) (C:\Users\Leizi of the official second\Desktop\Future village chief\image -20210604205545926.png)]