Thursday 25 February 2016

INTRODUCTION TO FUNCTIONAL DEPENDENCIES


As we discussed in previous section, a relation R from set A to B is a function,

if and only if, For every element in A, there is only one unique image in B.

Extending this concept to tables.

Lets say in a table there are two columns, A and B.

Both A and B contain values or data, thus they are both sets.

A->B, means that there is a function from A to B.

A
B
1
a
2
b
3
a
4
c
5
d
6
d
As we can see in the table each element in A is mapped to a unique element in B.

FORMALLY

A->B,
Means, 
           If, 
               row1(A)=a AND there is another row2 such that row2(A)=a
           Then,
                row1(A)=row2(B)=b 

In simple terms if in a table we have two rows with same value ‘a’ in column A, then as A->B,

‘a’ is associated with a unique value ‘b’ in B. Thus whenever we see ‘a’  we can say that value in column B will be ‘b’



TEST YOURSELF

Which of the functional dependencies are valid for the given tables:


1.

Eid
Ename
1
a
2
b
3
b
a.) Eid->Ename
b.) Ename->Eid
c.) none

2.

A
B
1
1
1
2
2
2
a.) A->B
b.) B->A
c.) None

3.

A
B
C
1
1
4
1
2
4
2
1
3
2
2
3
2
4
3

a.) A->B
b.) B->C
c.) B->A
d.) C->B
e.) A->C
f.) C->A





Answers:
1-a 
2-c
3-e,f


NEXT:

VARIOUS USAGES OF FUNCTIONAL DEPENDENCIES:

1) Identifying additional functional dependencies from given functional dependencies
2) Identifying candidate keys
3) Identifying equivalent functional dependencies
4) Finding minimal functional dependencies

METHOD USED (Not the only method)


  • CLOSURE SET of attributes


No comments:

Post a Comment