Learning and thinking about the identification of function dependencies and multi-value dependencies in Databases

Source: Internet
Author: User
Let's first review what functions are: functions are a ing relationship between sets (I like to understand using graphs). The database has discussed a lot about non-trivial function dependencies, but it doesn't mean much.) because the score is not a subset of (student ID, course. Some function dependencies: (student ID, name) → gender (student ID, name) → gender and student ID →

Let's first review what functions are: functions are a ing relationship between sets (I like to understand using graphs). The database has discussed a lot about non-trivial function dependencies, but it doesn't mean much.) because the score is not a subset of (student ID, course. Some function dependencies: (student ID, name) → gender (student ID, name) → gender and student ID →

Let's first review what is a function: A function corresponds to a set (I like to understand it in graphs)

Most of the discussions in the database are non-trivial function dependencies, which are of little significance)

Because the score is not a subset of (student ID, course.

Some function dependencies: (student ID, name) → gender

Because (student ID, name) → gender and student ID → gender

Full function dependency: (student ID, course number) → score

Because (student ID, course number) → score, student ID-\ → score, course number-\ → score.

Transfer Function dependency: Student ID → department head

Because the student ID → department name, Department name → department head and department name-\ → student ID.

What about multi-value dependency? Define

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 relations is r, each value of r on (X, Z) corresponds to a group of Y values, this set of values is only determined by the X value and is not related to the Z value.
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 still use the ing relationship of the function to understand and introduce f (x, y). Suppose f (x, y) = +-(x ^), if z = f (x, y), then an x value can be used to obtain two z pairs with opposite numbers. In this binary function relationship, the value of y does not actually affect the result. Similar to the relational mode, x is the property value of X set, y is the property value of Y set, and z is the property value of Z set.

Let's look at an example.

(Course C) -- (instructor T)-(reference B)

Database probability-instructor Gu Guosheng-Mathematical Analysis
Database probability-instructor Gu Guosheng-Higher Algebra
Database probability-instructor Gu Guosheng-Differential Equations

In the preceding example, U {C, T, B}, where course C and instructor T uniquely determine a group of B, but it has nothing to do with T. It is determined by C. However, T is not an empty set, therefore, it is a non-trivial multi-value dependency.

In fact, when T is null, if every value C in c corresponds to a definite value in B, it becomes a function dependency. Therefore, function dependency is a special case of multi-value dependency.

Total:

1. function dependency is not a constraint that is met by one or some relational instances in relational mode R, but a constraint that must be met by all relational instances in R.

2. function dependency is the concept of semantic category. Function dependencies can only be determined based on the data semantics. (For example, the function "name → age" is dependent only when the same celebrity is not allowed)

3. function dependencies are usually discussed in a collection.

4. Database designers define functional relationships as needed. For example, "Name> Age" is considered feasible in a specific table.

5. Database designers make mandatory requirements according to actual regulations. For example, if the same celebrity is not allowed to appear, the function depends on "Name> age. The inserted tuples must meet the requirements.

Function dependency. If the same celebrity exists, this tuple is not loaded.




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.