You are on page 1of 9

The functional

dependency
- Introduction
Functional dependencies
Adatbázisrendszerek és alkalmazásaik
The functional dependency
The functional dependence is a kind of constraint, which
stands between two set of attributes of the database.

Let’s say, our relational database scheme has n attributes:


A1, A2, …, An
and let’s think about our whole relational scheme as we
can describe it with only a single universal relational
scheme R = {A1,A2, … ,An}.

Adatbázisrendszerek és alkalmazásaik >> Funkcionális függések


The functional dependency

A functional dependency, denoted by X → Y, between two sets


of attributes X and Y that are subsets of R specifies a constraint
on the possible tuples that can form a relation state r of R. The
constraint is that, for any two tuples t1 and t2 in r that have t1[X] =
t2[X], they must also have t1[Y] = t2[Y].

On other words, X functionally determines Y in a relation schema R if, and only


if, whenever two tuples of r(R) agree on their X-value, they must necessarily
agree on their Y value.

Adatbázisrendszerek és alkalmazásaik >> Funkcionális függések


The functional dependency
Loosely translated:
The values of records of the component Y in the r depend on the
values of component X, so values of a record of the component
X clearly (or functionally) defines the values of the component Y.
We can say also: X functionally defines Y, or
Y functional depends on X.
The set of attributes X is called the left-hand side of the
functional dependence, and Y is called the right-hand side.

Adatbázisrendszerek és alkalmazásaik >> Funkcionális függések


Notice
If X → Y holds in R, it does not mean that Y → X is true or
not in R.

If both of the functional dependencies X → Y, and Y → X


hold, it is the mutual functional dependence ( really rare).

If neither of the functional dependencies X → Y, and


Y → X hold, then X and Y are functionally independent sets
of attributes.

Adatbázisrendszerek és alkalmazásaik >> Funkcionális függések


Signing of the functional
dependence
During the signing of the functional dependencies, the parentheses of the set
and the commas what divide the values of the set could be left, if the attributes
are with one lettered name identified.
(and also one valued sets)
As an example: istead of {A,B } → {C } AB → C,
and instead of {A,B,C } → {D,E} ABC → DE.
If X and Y describes sets of attribute, then in both of the sides of the functional
dependencies is adaptable to use the simplification XY to sign the union of the
two sets of attribute. As an example:
Instead of X ∪ Y → Z the XY → Z is also acceptable.

Adatbázisrendszerek és alkalmazásaik >> Funkcionális függések


Example for the functional
dependence

Functional dependencies:
1.Ssn → Ename
2.Pnumber → {Pname, Plocation}
3.{Ssn, Pnumber} → Hours

Adatbázisrendszerek és alkalmazásaik >> Funkcionális függések


Explanation of the functional
dependencies
The most important definition of the relational databases.
A property of the semantic, so it depends only on the
meaning of the attriburtes.
The semantics of two sets of attributes in R indicate that a
functional dependency should hold, then we specify the
dependency as a constraint :
written in DDL language of the database management.

Adatbázisrendszerek és alkalmazásaik >> Funkcionális függések


Explanation of the functional
dependencies
A legal extension is a relational scheme, which satisfies
the functional dependence.
The states of th relation should be legal, too.
The functional dependence sometimes holds
automatically.
As an example:
Postal_code → Area_code

Adatbázisrendszerek és alkalmazásaik >> Funkcionális függések

You might also like