Thursday 25 February 2016

FUNCTIONAL DEPENDENCIES


PREREQUISITES
Before we start with functional dependencies it is important to review the topics sets, relations and functions, as the whole database revolves around it. Also the term from one set to another.


SETS, RELATIONS AND FUNCTIONS


SETS

A set is a well defined collection of objects.
By ‘well defined’ we mean that given any object, we could look at it and say if it belongs to the set or not.
Example:
·       Collection of driving licenses of people of a country is a set
·       Collection of cources in a university is a set
·       Collection of smart students in a class is not a set, as it is ambiguous to say if a student is smart or not and is more of a personal opinion.

RELATIONS

Consider the following example :
Set A={Harry, Mark, Russell, Bruce}
Set B={Suzy, Jessica, Chritine}
Suppose Suzy has two brothers Harry and Mark,
Jessica has one brother Russell, and Chritine has one brother Bruce.
If we define a relation R " is a brother of" between the elements of A and B then clearly.
Harry R Suzy, Mark R Suzy, Russell R Jessica, Bruce R Chritine.
Instead of writing R between two names these can be written in the form of ordered pairs as :
(Harry, Suzy), (Mark, Suzy), (Russell, Jessica), (Bruce, Chritine).
The above information can also be written in the form of a set R of ordered pairs as
R= {(Harry, Suzy), (Mark, Suzy), (Russell, Jessica), Bruce, Chritine}
Clearly R Í A´B, i.e.R = {(a,b):aÎ Î A,b B and aRb}
If A and B are two sets then a relation R from A to B is a sub set of A×B



FUNCTIONS

Consider the relation:
                                                     f : {(a, 1), (b, 2), (c, 3), (d, 5)}


In this relation we see that each element of A has a unique image in B
This relation f from set A to B where every element of A has a unique image in B is defined as a function from A to B.
Therefore, we can say function is a relation in which no two ordered pairs have the same first element.
We also see that an element of B, i.e., 4 which does not have its preimage in A.
Symbolically, this function can be written as
f : A ->B




Now that we have understood the concepts of sets, relations and functions, lets move on with Functional Dependencies!!!

No comments:

Post a Comment