[] DBMS HKUST slides8 decomposition algorithm paradigms and knowledge summary

Paradigm Definition: compliance with a set of relational schema of a certain kind of level, indicating the degree of contact between the internal rationalization of each attribute a relationship

Visualize understand: a data table table structure in line with the level of certain design standards

Relationship with the relational model:

Relationship "is" "an instance, you can put" relational model relationship "as a table with data, and the" relational model "is the table structure this data table.

1NF

1NF is defined as: 1NF relations in line with each property can not be divided.

Three relationships integrity constraints

Entity integrity : Any one attribute relationship can not be included in the code is empty, a combination of all the properties can not be overlapped.

(Entity integrity of the request, the master properties can not be empty.)


2NF

On the basis of the 1NF 2NF, eliminating the non-primary attributes of a code-dependent part of the function .

In the process of resolution, the higher the requirements to achieve a paradigm, a process called "mode decomposition."

Remain non-primary property department a code student number transfer function dependent.


3NF (third normal form, third normal form)

On the basis of 3NF 2NF, eliminating the non-primary property for the transfer function code dependent .

The definition : Consider a functional dependency relationship pattern set F R, F + to all of the form α → β functional dependency (α⊆R and β⊆R), if at least one of the following holds:

  • α → β is trivial functional dependency (ie β⊆α);

  • α is a super-code of the R pattern.

  • β - α for each attribute A are contained in one of R candidate code. (Candidate code: minimum Supersize)

Let R belongs to the 3NF.

If there is a non-primary property dependent transfer function codes, not meet the requirements of 3NF.

(It may have at least three attributes dependencies transfer function)

3NF database designed to meet the requirements, basically solve the data redundancy is too large, the insertion abnormalities, abnormal modify, delete abnormal problems.


BCNF(Boyce-Codd范式,Boyce-Codd Normal Form)

3NF eliminated based on the main properties for some of the transfer function code dependent.

You can eliminate all redundant based on functional dependencies can be found.

The definition : Consider a functional dependency relationship pattern set F R, F + to all of the form of functional dependency α → β (α⊆R and β⊆R), if at least one of the following holds:

  • α → β is trivial functional dependency (ie β⊆α);

  • α is a super-code of the R pattern.

R belongs to the relational schema BCNF.


Functional dependency (Functional dependencies)

Consider relational schema r (R), attribute set α⊆R, attribute set β⊆R.

If the instance for a given a r (R) of all tuples of t1 and t2 always satisfies "If t1 [α] = t2 [α], is t1 [β] = t2 [β]", then the instance is satisfied ( Satisfy) functional dependency α → β.

  • Trivial functional dependency (Trivial Functional Dependency): If β⊆α, such as the shape of the functional dependency α → β is trivial.

  • Nontrivial function dependent (Non-Trivial Functional Dependency)

If each valid instance r (R) satisfies both functional dependency α → β, the function depends on the mode established r (R) (hold).

Closure (closure): Let F be a set of functional dependencies, F the closure is a function dependent set contains all F logic, called F +.

Armstrong axioms ( Armstrong's Axiom ): you can find a whole set of F + F

  • Reflexive law ( reflexivity rule ) : beta] and [alpha] attribute set given, if β⊆α, the α → β established;

  • Added Law ( Augmentation rule): a given set of attributes α, β and gamma], when α → β is satisfied, the γα → γβ established. (γα expressed γ∪α)

  • Transfer law ( transitivity rule): a given set of attributes α, β and gamma], when α → β holds and β → γ is satisfied, the α → γ established.

:( three extended rules to simplify the calculation)

  • The combined law ( Union rule): a given set of attributes α, β and gamma], when α → β holds and α → γ is satisfied, the α → βγ established.

  • Decomposition law ( Composition rule): a given set of attributes α, β and gamma], when α → βγ established, the establishment of the α → β and α → γ established.

  • Pseudo transfer law ( pseudotransitivity rule): a given set of attributes α, β, γ, and [delta], when α → β holds and γβ → δ is satisfied, the αγ → δ established.

Closure attribute set

[alpha] of the closure α +: functional dependency sets all attributes [alpha] F is a function of the determined set of

Closure α + calculated attribute efficient algorithm:

Decomposition (decomposition)

Lossless join decomposition (lossless-join decomposition) is the destructive decomposition

  • If the (R) and R2 (R) R & lt substitute (R) mode with two relations r1 without loss of information, then we call this decomposition is lossless decomposition (lossless decomposition)

Holding dependence (Dependency preservation)

Maintaining dependent decomposition (dependency-preserving decomposition)

  • If decomposition is kept dependent, a database update is given, all the functional dependence can be verified by a separate relationship, calculated without connection relationship decomposed.
  • 3NF is to maintain and meet the highest dependence paradigm lossless decomposition

BCNF decomposition algorithm (BCNF decomposition algorithm)

  1. First Order reslut = {R}

  2. Next calculate closure function F F + (calculated function closure very troublesome, when it is determined in the following pick a functional dependency, a judgment whether the logical implication to F)

  3. Which is then judged whether there BCNF normal mode does not satisfy the result in result set, if both satisfied, then skip to step 5, if there is a schema Ri ∈ result, BCNF normal is not satisfied, go to step 4

  4. Selecting a set up on a non-trivial function Ri dependency α → β, and α → β belong to F +, and α∩β = ∅. Then Ri pattern into two patterns, namely (Ri - β) and (α, β). Ri and removed from the result, the river get two new modes added to result in. Then returns to step 3 to continue determined

  5. To complete the decomposition, the output

Certain non-destructive, but not necessarily remain dependent on


3NF decomposition algorithm (3NF decomposition algorithm)

Regular cover (Canonical Cover): minimal functional dependencies

  • If the removal of a functional dependency attribute is not changed in the closure of the functional dependencies , called the attribute is irrelevant ( extraneous )
  1. First find F regular coverage Fc (in fact, is the use of the process of formulating Jane Amstrong original set of functional dependencies)

  2. Then each of the Fc-dependent function is decomposed into a separate pattern, to obtain a list of patterns S = {R1, R2, ..., Ri}

  3. If any one of the above-described mode list mode S contains the candidate code pattern R, skip to step 5, otherwise, execute Step 4

  4. Select any of a candidate code R, to form a new pattern of R ', the R' S is added to the list mode,

  5. (Optional) If there are redundant (ie a mode other modes are included) mode list, you can delete this model

  6. Output S

The decomposition algorithm can remain dependent, and is an exploded lossless

Guess you like

Origin www.cnblogs.com/Ryan0v0/p/11222160.html