Multi-value dependency and partial function dependency Conversion

Source: Internet
Author: User

Finally understood the multi-value dependency to the http://blog.csdn.net/smstong

"

Multi-value dependency definition:

Let R (u) be a relational pattern on an attribute set U, x, y, and z are subsets of U, and z = U-X-Y, multi-value dependency X-> Y is true. If only one of the R's relations is R, each value of R on (x, z) corresponds to oneGroupThe value of Y, which is determined only by the value of X and is irrelevant to the value of Z.

If X-> Y and Z = empty set, X-> Y is an ordinary multi-value dependency. Otherwise, X-> Y is a non-trivial multi-value dependency.

We can see that ifGroupChange to 1ItemsThe multi-value dependency becomes the function dependency. Of course, a group composed of values is also a group. Therefore, function dependency is a special case of multi-value dependency.

See the following table:

course C instructor T reference B

Mathematical Analysis of Deng Jun

mathematical Deng Jun advanced algebra

Mathematical Deng Jun Differential Equation

In the table, u = C + T + B, (C, T) determines a group of B, but this group of B is not related to T, which is determined only by C, so (C, T) -> B. Because t is not an empty set, (C, T)-> B is a non-trivial multi-value dependency.

To eliminate multiple dependencies, we can break them down into: (C, T), (C, B) and

Table 1:

Course C instructor T

Mathematics Deng Jun

Table 2:

Course C reference B

Mathematical Analysis

Advanced Mathematics Algebra

Mathematical Differential Equations

For each non-trivial multi-value dependency X-> Y (Y does not belong to X) in R, X contains a candidate code, and r belongs to 4nf.

Analysis: for each non-trivial multi-value dependency X-> Y, if X contains a candidate code, that is, X-> y, therefore, the non-trivial multi-value dependencies allowed by 4nf are function dependencies.

"

.

Baidu Knows

"

Function dependency is a uniquely determined relationship, for example, teaching in a table (course number, course name, course credits, instructor number, instructor name, reference book number, reference book name ). Of course, the primary key of this table is (course number, instructor number, reference book number)

The course name and Course Credit function depend on the course number, that is, the course number uniquely identifies the name and credits;

Similarly, the instructor's name function depends on the instructor's number. For details, refer to the title function dependency reference number.

However, the instructor number may depend on the course number for multiple values, because a combination of course Numbers (course number, reference number) may correspond to multiple instructor numbers. This is because multiple teachers can use the same or different reference books to take the same course.

To put it simply, a function is a uniquely identified relationship, but a multi-value dependency cannot be uniquely identified.

"

.

I understand it only after reading Baidu. I can't understand all the standard formulas. Some function dependencies are special multi-value dependencies, multi-value dependency refers to the combination of multiple teachers dependent on the same (course number, reference number), and some function dependencies depend only on one teacher (course number, reference number ), that is, Lao Wang depends on 01 in (01, database). This is part of the function dependency. If another old five also depends on 01 in (01, database), it is multi-value dependency, some functions depend on one thing.

.

Paste a step into 4nf

"

Generally, the primary key only depends on function dependencies, but it is not unrelated to multi-value dependencies.
The problem you are talking about is like splitting a link into 4nf and 4nf.
1. first, the relationship pattern is decomposed into bcnf, eliminating the multi-value dependency based on function dependencies and non-inclusion codes, because the left part of the function dependency in each sub-mode contains codes (there is a method for decomposing the code into bcnf in the book)
2. then, in the Relationship Mode decomposed into bcnf, check whether there are non-trivial multi-value dependencies based on function dependencies, that is, for example, a sub-mode has x --> Y, X --> Z, Z = U-X-Y, Z non-empty set, at this time must be X Not-> Y and X Not-> Z,
The sub-mode is decomposed into (x, y) and (x, z) into 4nf. In theory, this is the case. Of course, this is not required for the average number of workers to answer questions, sometimes, when it is decomposed into 3nf and bcnf, the original multi-value dependency will be damaged.

"

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.