Functional dependency

Functional dependency

A functional dependency (FD) is a constraint between two sets of attributes in a relation from a database.

Given a relation "R", a set of attributes "X" in "R" is said to functionally determine another attribute "Y", also in "R", (written "X" → "Y") if and only if each "X" value is associated with precisely one "Y" value. Customarily we call "X" the "determinant set" and "Y" the "dependent attribute". Thus, given a tuple and the values of the attributes in "X", one can determine the corresponding value of the "Y" attribute. For the purposes of simplicity, given that "X" and "Y" are sets of attributes in "R", "X" → "Y" denotes that "X" functionally determines each of the members of "Y" - in this case "Y" is known as the "dependent set". Thus, a candidate key is a minimal set of attributes that functionally determine all of the attributes in a relation.

:(Note: the "function" being discussed in "functional dependency" is the function of identification.)

A functional dependency FD:X o Y is called trivial if Y is a subset of X.

The determination of functional dependencies is an important part of designing databases in the relational model, and in database normalization and denormalization. The functional dependencies, along with the attribute domains, are selected so as to generate constraints that would exclude as much data inappropriate to the user domain from the system as possible.

For example, suppose one is designing a system to track vehicles and the capacity of their engines. Each vehicle has a unique vehicle identification number (VIN). One would write VINEngineCapacity because it would be inappropriate for a vehicle's engine to have more than one capacity. (Assuming, in this case, that vehicles only have one engine.) However, "EngineCapacity" → "VIN", is incorrect because there could be many vehicles with the same engine capacity.

This functional dependency may suggest that the attribute EngineCapacity be placed in a relation with candidate key VIN. However, that may not always be appropriate. For example, if that functional dependency occurs as a result of the transitive functional dependencies

:mbox{VIN}, o,mbox{VehicleModel}, mbox{VehicleModel}, o,mbox{EngineCapacity},

then that would not result in a normalized relation.

Irreducible function depending set

A functional depending set S is irreducible if the set has three following properties:

# Each right set of a functional dependency of S contains only one attribute.
# Each left set of a functional dependency of S is irreducible. It means that reducing any one attribute from left set will change the content of S (S will lose some information).
# Reducing any functional dependency will change the content of S.

Sets of functional dependencies with these properties are also called "canonical" or "minimal".

Properties of functional dependencies

Given that "X", "Y", and "Z" are sets of attributes in a relation "R", one can derive several properties of functional dependencies. Among the most important are Armstrong's axioms, which are used in database normalization:
* Subset Property (Axiom of Reflexivity): If "Y" is a subset of "X", then "X" → "Y"
* Augmentation (Axiom of Augmentation): If "X" → "Y", then "XZ" → "YZ"
* Transitivity (Axiom of Transitivity): If "X" → "Y" and "Y" → "Z", then "X" → "Z"

From these rules, we can derive these secondary rules:
* Union: If "X" → "Y" and "X" → "Z", then "X" → "YZ"
* Decomposition: If "X" → "YZ", then "X" → "Y" and "X" → "Z"
* Pseudotransitivity: If "X" → "Y" and "YZ" → "W", then "XZ" → "W"
* Accumulation: If "X" → "YZ" and "Z" → "V", then "X" → "YZV"
* Extension: If "X" → "Y" and "W" → "Z", then "WX" → "YZ"

Equivalent sets of functional dependencies are called covers of each other. Every set of functional dependencies has a canonical cover.

See also

* Multivalued dependency (MVD)


Wikimedia Foundation. 2010.

Игры ⚽ Поможем написать реферат

Look at other dictionaries:

  • functional dependency — noun A constraint between two sets of attributes in a relation …   Wiktionary

  • trivial functional dependency — noun A functional dependency of an attribute on a superset of itself …   Wiktionary

  • Dependency — or dependent may refer to: Contents 1 Sciences 1.1 Computer science 1.2 Economics 1.3 Linguistics 1.4 …   Wikipedia

  • Dependency grammar — Hybrid constituency/dependency tree from the Quranic Arabic Corpus Dependency grammar (DG) is a class of syntactic theories developed by Lucien Tesnière. It is distinct from phrase structure grammars, as it lacks phrasal nodes. Structure is… …   Wikipedia

  • Dependency (UML) — A dependency in the Unified Modeling Language exists between two defined elements if a change to the definition of one may result in a change to the other. In UML this is indicated by a dashed line pointing from the dependent (or client) to the… …   Wikipedia

  • Functional decomposition — refers broadly to the process of resolving a functional relationship into its constituent parts in such a way that the original function can be reconstructed (i.e., recomposed) from those parts by function composition. In general, this process of …   Wikipedia

  • Dependency theory (database theory) — Dependency theory is a subfield of database theory which studies implication and optimization problems related to logical constraints, commonly called dependencies, on databases. The best known class of such dependencies are functional… …   Wikipedia

  • Functional programming — In computer science, functional programming is a programming paradigm that treats computation as the evaluation of mathematical functions and avoids state and mutable data. It emphasizes the application of functions, in contrast with the… …   Wikipedia

  • Dependency diagram — A dependency diagram is a visual representation of a dependency graph. Dependency diagrams are integral to software development, outlining the complex, interrelationships of various functional elements. Typically in a dependency diagram, arrows… …   Wikipedia

  • Transitive dependency — In mathematics, a transitive dependency is a functional dependency which holds by virtue of transitivity. A transitive dependency can occur only in a relation that has three or more attributes. Let A, B, and C designate three distinct attributes… …   Wikipedia

Share the article and excerpts

Direct link
Do a right-click on the link above
and select “Copy Link”