DATABASE function dependency

Source: Internet
Author: User

I. Concept of function dependency
A type of data dependency that reflects the dependency and mutual constraints between attributes or attribute groups, that is, the constraints in the real world.

Ii. Definition
R (u) is a relational mode on the property U. Both X and Y are u = {A1, A2 ,..., The subset of an}, where R is any relation of R. If any two tuples U and V in R have U [x] = V [X], if u [y] = V [y] exists, the X function determines Y, or the y function depends on X and is recorded as X → y.
Example:
(Sno-student ID, TNO-instructor ID, CNO-course Id, sname-Student name, tname-instructor name, cname-Course name, grade-score)
1. Sno → sname, CNO → cname, (SNO, CNO) → grade √
2. sname → SnO, TNO → CNO, SnO → tname ×

Iii. function dependency is a semantic category
1. Semantics: the essential link between real-world things reflected by data
2. determine the existence of function dependency based on Semantics
3. function dependency reflects the general rules between attributes. constraints must be met in any relational R in relational mode.

4. Relationship between attributes determines the function dependency
Set X and Y to a subset of U.
1. If the relationship between x and y is, then X → y, y → X. (Dependency, which can be recorded as X dependencies → y)
2. If the relationship between x and y is M: 1 (m), then X → y.
3. If the relationship between x and y is M: n (m, n), there is no function dependency between x and y.

V. Full function dependency and partial function dependency
1. function dependencies are divided into full function dependencies and partial function dependencies.
2. Definition:
In R (u), if X → y and any real subset of X has x 'y', then Y is totally dependent on X, it is written as X → y; otherwise, if X → y and X contains a real subset of X, making X → y true, the y part depends on X.
Example:
Student ID, Student name, course Id, course name, score
(Student ID, course Id) → score
The score cannot depend on either the student ID or the course Id. Therefore, the score function relies on keywords.
(Student ID, course Id) → Student name
Student ID → Student name
The Student name can depend on a primary attribute of the keyword-student ID. Therefore, some functions of the Student name depend on (student ID, course Id ).

Vi. dependencies between ordinary functions and non-ordinary functions
Set X and Y to the property set of a link, and X → y
1) if y is contained in X, it is called X → y as: ordinary function dependency; (SNO, CNO) → Sno (SNO, CNO) → CNO
2) if y is not included in X, X → y is called a non-trivial function dependency. (SNO, CNO) → grade
Y is contained in X, W is located in X, and Y is not directly overlapped.
Then: X → y indicates the normal function dependency.
X → W, W → Y: non-trivial function dependency

7. If the transfer function depends on X → y, and y → Z, then the Z transfer function depends on X.

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.