Decomposition algorithms that convert to 3NF hold function dependencies:

Source: Internet
Author: User
Tags terminates

Decomposition algorithms that convert to 3NF hold function dependencies:

Ρ={r1<u1,f1>,r2<u2,f2>,..., Rk<uk,fk>} is a decomposition of the relational pattern r<u,f>, u={a1,a2,..., an},f={fd1,fd2,..., FDp}, and set F is a minimum dependency set, note FDI as XI→ALJ, the steps are as follows:

① the function dependency set F of the r<u,f> is minimized (the processed result is still recorded as f);

② find properties that do not appear in F, and make such attributes a relational pattern. Remove these attributes from U, and the remaining attributes are still remembered as u;

③ If there is x→a€f, and Xa=u, then ρ={r}, the algorithm terminates;

④ Otherwise, the f is grouped by a principle with the same left part (assuming a K-group), and each set of functions relies on all the attributes involved in fi to form an attribute set UI. If Ui¢uj (i≠j), remove the UI. As a result of the step ②, so the composition of a hold function dependent decomposition. Also, each ri (Ui,fi) belongs to 3NF and maintains the function dependency.

Example 1: The relational pattern R<u,f>, where u={c,t,h,i,s,g},f={cs→g,c→t,th→i,hi→c,hs→i}, decomposes it into 3NF and keeps the function dependent.

(i) Calculating the minimum function dependency set of f

① uses decomposition rules to turn all function dependencies into a function dependency of a single property on the right. Since the right side of all function dependencies of f is a single attribute, no decomposition is necessary.

② Remove redundant function dependencies in F

A Set Cs→g as a redundant function dependency, then remove the cs→g to:

F1={c→t,th→i,hi→c,hs→i}

Calculation (CS) f1+:

Set X (0) =cs

Calculate x (1): Scan F1 for function dependencies, find a function dependency on left CS or CS subset, find a c→t function dependency. So there are X (1) =x (0) ∪t=cst.

Calculation x (2): Scans the individual function dependencies in the F1, finds the function dependencies on the left side of the CST or CST subset, and finds no function dependencies. So there are X (2) =x (1). The algorithm terminates.

(CS) f1+= CST does not contain G, so cs→g is not a redundant function dependency and cannot be removed from F1.

B Set C→t as a redundant function dependency, then remove the c→t to:

F2={cs→g,th→i,hi→c,hs→i}

Calculation (C) f2+:

Set X (0) =c

Calculation x (1): Scans the F2 for each function dependency, and does not find the function dependency of C on the left. So there are X (1) =x (0). The algorithm terminates. Therefore, c→t is not a redundant function dependency and cannot be removed from the F2.

C Set Th→i as a redundant function dependency, then remove the th→i to:

F3={cs→g,c→t,hi→c,hs→i}

Calculation (TH) f3+:

Set X (0) =th

Calculation x (1): Scans the individual function dependencies in the F3, and does not find the function dependency of the left part as th or th subset. So there are X (1) =x (0). The algorithm terminates. Therefore, Th→i is not a redundant function dependency and cannot be removed from the F3.

D Set Hi→c as a redundant function dependency, then remove the hi→c to:

F4={cs→g,c→t,th→i,hs→i}

Calculation (HI) f4+:

Set X (0) =hi

Calculation x (1): Scans the individual function dependencies in the F4, and does not find a function dependency on the left side as a subset of hi or hi. So there are X (1) =x (0). The algorithm terminates. Therefore, Hi→c is not a redundant function dependency and cannot be removed from the F4.

E. Set Hs→i as a redundant function dependency, then remove the hs→i to:

F5={CS→G,C→T,TH→I,HI→C}

Calculation (HS) f5+:

Set X (0) =hs

Calculation x (1): Scans the F5 for individual function dependencies, and does not find a function dependency on the left part of the HS or HS subset. So there are X (1) =x (0). The algorithm terminates. Therefore, Hs→i is not a redundant function dependency and cannot be removed from the F5. That is: F5={cs→g,c→t,th→i,hi→c,hs→i}

③ remove each function in the F5 depends on the left superfluous attribute (check only the left is not a single property of the function dependency)

There is no dependency on the function on the left that has extra attributes. Therefore, the minimum function dependency set is:

F={cs→g,c→t,th→i,hi→c,hs→i}

(b) Since all the properties in R appear in F, go to the next step.

(iii) by the principle of having the same left part of F is divided into: r1=csg,r2=ct,r3=thi,r4=hic,r5=hsi. So Ρ={r1 (CSG), R2 (CT), R3 (THI), R4 (HIC), R5 (HSI)}.

Fame: This article is reproduced from Baidu Library

Http://wenku.baidu.com/link?url= Muyz--karierppnbvyaa5mb5f6lgcttr41ofmv8lemcivo96fmq-zbytetzf-blew1um6a3bkb0qkxwe7d3ar9dyfsew-_htmftpcbl0qli

Decomposition algorithms that convert to 3NF hold function dependencies:

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.