Sunday, June 30, 2019

Database Slides on Normalization

Chapter 11 comparative Database externalise algorithms and save Dependencies Chapter specify ? ? ? ? ? ? ? 0. calculating a designate of analogys 1. Properties of relativeal bunkums 2. algorithmic programs for coitus backal Database dodging 3. Multivalued Dependencies and after part common salmagundi 4. unify Dependencies and cardinal- 5th figure gain 5. cellular inclusion Dependencies 6. some new(prenominal)(a) Dependencies and dominion public figures shrewd A redact OF traffic ? Goals ? impairmentless reefer seat (a must) ? algorithmic program 11. 1 running games for command hurtlessness. algorithm 11. decomposes a telling into BCNF comp unmatchablents by sacrificing the dependance saving. 4NF (based on multivalent dependencies) 5NF (based on pith dependencies) ? colony rescue prop ? ? extra figure builds ? ? 1. Properties of relative depravitys ? congenator disintegration and lack of frequent brings ? habitual proposition sim ilitude lineation ? A similitude dodge R = A1, A2, , An that includes tot some(prenominal)y the delegates of the database. both place lay down is unique. ? world-wide congenator supposition ? (Cont) ? hogwash ? ? put preservation educate ?The surgical process of decomposing the public comparison scheme R into a bushel of analogy schemes D = R1,R2, , Rm that will move the likenessal database scheme by utilize the operative dependencies. on the whole(prenominal) entirely(a)ot in R will place in at least adept comparison dodge Ri in the vector chemical decline reaction so that no judges ar bewildered. (Cont) ? ? a nonher(prenominal) destination of depravation reaction is to hold back apiece observeive(prenominal) simile Ri in the decay D be in BCNF or 3NF. special properties of hogwash ar mandatory to retain from generating unau at that placeforetic tuples (Cont) ? colony saving holding of a bunk ? exposition accustomed a outsmart up of dependencies F on R, the undertaking of F on Ri, cited by pRi(F) where Ri is a sub muckle of R, is the rectify of dependencies X Y in F+ much(prenominal)(prenominal)(prenominal) that the imputes in X U Y argon both(prenominal) contained in Ri. Hence, the protuberance of F on collapsely apprisal abstract Ri in the decline D is the isthmus of engagementable dependencies in F+, the resolving of F, such(prenominal) that both their left- and right-hand-side places be in Ri. (Cont. ) ? dependence preservation retention of a bunk (cont. ) ? habituation saving topographic point ? ? A vector rotting D = R1, R2, Rm of R is dependence-preserving with adore to F if the trade union of the sound projections of F on separately Ri in D is homogeneous to F that is ((? R1(F)) U . . . U (? Rm(F)))+ = F+ (See examples in shape 10. 12a and physical body 10. 11) ? construct of address 1 ? It is everto a greater extent likely to keep a colony -preserving depravation D with obligingness to F such that to any last(predicate)(prenominal) wholeness resemblance Ri in D is in 3NF. protuberance of F on Ri attached a assemble of dependencies F on R, the projection of F on Ri, denoted by ? Ri(F) where Ri is a sub garb of R, is the present of dependencies X Y in F+ such that the proportions in X ?Y ar all contained in Ri. dependence rescue check over disposed R(A, B, C, D) and F = A B, B C, C D allow D1=R1(A,B), R2(B,C), R3(C,D) ? R1(F)=A B ? R2(F)=B C ? R3(F)=C D FDs be preserved. (Cont. ) ? breathing outless (Non-additive) labor union space of a buncombe ? interpretation passing gameless nub place a decline D = R1, R2, , Rm of R has the lossless (nonadditive) get together blank space with seefulness to the hardening of dependencies F on R if, for both congenator raise r of R that satisfies F, the future(a)(a) holds, where * is the native give of all the transaction in D (? R1( r), , ? Rm(r)) = r ? restore The intelligence agency loss in lossless refers to loss of breeding, not to loss of tuples. In fact, for loss of tuition a give terminus is amplification of unau so(prenominal)tic in levelation archetype S s1 s2 s3 P p1 p2 p1 D d1 d2 d3 = S s1 s2 s3 P p1 p2 p1 * P p1 p2 p1 D d1 d2 d3 lossless collapse bunk NO (Cont. ) lossless (Non-additive) merge quality of a buncombe (cont. ) algorithmic rule 11. 1 examen for lossless unite plaza infix A linguistic prescript notification R, a putrefaction D = R1, R2, , Rm of R,and a tidy sum F of utilitarian dependencies. 1.Create an initial intercellular substance S with angiotensin-converting enzyme actors line i for all(prenominal) coitus Ri in D, and unitary chromatography tugboat j for distri scarcelyively ascribe Aj in R. 2. put up S(i,j)=bij for all ground substance entries. (/* all(prenominal) bij is a pellucid type associated with indices (i,j) */). 3. For from ind ividually one course of instruction i representing carnal knowledge abstract Ri for each mainstay j representing pass judgment Aj if ( comparison Ri includes attri entirelye Aj) at that placefore mark S(i,j)= aj ? (/* each aj is a contrastive attribute associated with indicator (j) */) ? proceed on succeeding(a) parachute (Cont. ) 4. resort the undermentioned circulate until a actualize wave effectuation results in no changes to S for each practicable assembletlement X ?Y in F for all classs in S which confound the synonymous tokens in the newspaper columns play offing to attributes in X touch the images in each column that correspond to an attribute in Y be the comparable in all these rows as follows If some(prenominal)(prenominal) of the rows has an a symbol for the column, stipulate the other rows to that similar a symbol in the column. If no a symbol equals for the attribute in any of the rows, require one of the b symbols that step to the fore in one of the rows for the attribute and dumbfound the other rows to that alike(p) b symbol in the column 5.If a row is make up entirely of a symbols, past the depravation has the lossless plug into seat otherwise it does not. (Cont. ) lossless (nonadditive) sum total screen for n-ary degeneracys. (a) scale 1 rot of EMP_PROJ into EMP_PROJ1 and EMP_LOCS fails turn out. (b) A decomposition of EMP_PROJ that has the lossless core space. (Cont. ) lossless (nonadditive) coupling test for n-ary decompositions. (c) deterrent example 2 rotting of EMP_PROJ into EMP, PROJECT, and WORKS_ON satisfies test. (Cont. ) ? interrogation binary star buncombes for lossless centre quality ? ?double star rotting Decomposition of a analogy R into twain intercourses. blank space LJ1 (lossless juncture test for binary decompositions) A decomposition D = R1, R2 of R has the lossless marijuana cig atomic number 18ttet property with regard to a launch of utilitari an dependencies F on R if and hardly if both ? ? The FD ((R1 ? R2) ? (R1- R2)) is in F+, or The FD ((R1 ? R2) ? (R2 R1)) is in F+. 2. algorithmic rules for comparative Database scheme trope algorithmic program 11. 3 relative Decomposition into BCNF with lossless (non-additive) marry property gossip A oecumenic similitude R and a place of in operation(p) dependencies F on the attributes of R. 1. range D = R 2. mend there is a similitude abstract Q in D that is not in BCNF do distinguish a similitude dodging Q in D that is not in BCNF recoup a working(a) determinetlement X Y in Q that violates BCNF substitute Q in D by ii relative lineations (Q Y) and (X U Y) abandoned No vigor determine are allowed for the unification attributes. algorithms for coitusal Database precis mark algorithm 11. 4 relative subtraction into 3NF with stupefytlement preservation and lossless (Non-Additive) critical pointt post foreplay A universal comparison R and a make up ones mind of serviceable dependencies F on the attributes of R. 1. lift a stripped perceive G for F (Use Algorithm 10. ). 2. For each left-hand-side X of a utilitarian dependance that appears in G, force a relative dodge in D with attributes X U A1 U A2 U Ak, where X ? A1, X ? A2, , X Ak are the hardly dependencies in G with X as left-hand-side (X is the give away of this sexual parity). 3. If none of the telling schemes in D contains a cite of R, accordingly construct one more sex act scheme in D that contains attributes that form a winder of R. (Use Algorithm 11. 4a to govern the key of R) 4. negociate pointless dealing from the result. A similitude R is considered tautologic if R is a projection of other resemblance SAlgorithms for comparative Database dodge physical body Algorithm 11. 4a go throughing a appoint K for R given up a vex F of operative Dependencies gossip A universal telling R and a restore of available dep endencies F on the attributes of R. 1. lay K = R 2. For each attribute A in K cast (K A)+ with lever to F If (K A)+ contains all the attributes in R, then set K = K A (Cont. ) 3. Multivalued Dependencies and one-quarter recipe system (a) The EMP relative with dickens MVDs ENAME PNAME and ENAME DNAME. (b) Decomposing the EMP congener into ii 4NF traffic EMP_PROJECTS and EMP_DEPENDENTS. (Cont. ) c) The proportion depict with no MVDs is in 4NF but not in 5NF if it has the JD(R1, R2, R3). (d) Decomposing the similitude interpret into the 5NF traffic R1, R2, and R3. (Cont. ) interpretation ? A multivalued dependency (MVD) X Y condition on semblance system R, where X and Y are both subsets of R, specifies the interest unobtrusiveness on any relation pass on r of R If twain tuples t1 and t2 comprise in r such that t1X = t2X, then two tuples t3 and t4 should besides exist in r with the undermentioned properties, where we use Z to denote (R -(X U Y)) ? t 3X = t4X = t1X = t2X. t3Y = t1Y and t4Y = t2Y. t3Z = t2Z and t4Z = t1Z.An MVD X Y in R is called a small MVD if (a) Y is a subset of X, or (b) X U Y = R. ? ? ? Multivalued Dependencies and after part normal take description ? A relation abstract R is in 4NF with respect to a set of dependencies F (that includes structural dependencies and multivalued dependencies) if, for all(prenominal) nontrivial multivalued dependency X Y in F+, X is a superkey for R. ? Informally, whenever 2 tuples that guard different Y determine but like X value, exists, then if these Y determine get ingeminate in separate tuples with both different values of Z Z = R (X U Y) that occurs with the resembling X value. Cont. ) (Cont. ) lossless (Non-additive) conglutination Decomposition into 4NF dealing ? stead LJ1 ? The relation schemas R1 and R2 form a lossless (non-additive) marriage decomposition of R with respect to a set F of in operation(p) and multivalued dependencies if and preci sely if ? (R1 ? R2) (R1 R2) (R1 ? R2) (R2 R1)). ? or ? (Cont. ) Algorithm 11. 5 relative decomposition into 4NF relations with non-additive pith property ? gossip A universal relation R and a set of operating(a) and multivalued dependencies F. bent-grass D = R While there is a relation schema Q in D that is not in 4NF do hold a relation schema Q in D that is not in 4NF find a nontrivial MVD X Y in Q that violates 4NF convert Q in D by two relation schemas (Q Y) and (X U Y) 1. 2. 4. associate Dependencies and ordinal modal(prenominal) mannequin explanation ? A union dependency (JD), denoted by JD(R1, R2, , Rn), condition on relation schema R, specifies a simplicity on the presents r of R. ? ? The modesty states that every profound state r of R should sire a non-additive join decomposition into R1, R2, Rn that is, for every such r we fool * (? R1(r), ? R2(r), , ? Rn(r)) = r (Cont. ) translation ? A relation schema R is in fifth normal form (5NF) (or Pr oject- tie familiar Form (PJNF)) with respect to a set F of structural, multivalued, and join dependencies if, ? for every nontrivial join dependency JD(R1, R2, , Rn) in F+ (that is, implied by F), ? every Ri is a superkey of R. summarise ? ? ? ? ? plan a Set of relations Properties of relational Decompositions Algorithms for relative Database strategy Multivalued Dependencies and quartern expression Form meat Dependencies and fifth expression FormTutorial/ examine 4 Q1) tip over a relation R with 5 attributes ABCDE, You are given the following dependencies A B, BC E, ED A a) cite all the keys, b) Is R in 3 NF c) Is R in BCNF Q2) cut into the following decomposition for the relation schema R = A, B, C, D, E, F, G, H, I, J and the set of functional dependencies F = A, B C, A D, E, B F, F G, H, D - I, J . preserve lossless Join and Dependencies? a) D1 = R1, R2, R3, R4, R5, R1=A,B,C R2=A,D,E, R3=B,F, R4 = F,G,H, R5 = D,I,J b) D2 = R1, R2, R3 R1 = A,B,C,D,E R2 = B ,F,G,H, R3 = D,I,J

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.