Functional Dependency
Functional Dependency
holds on R if and only if for any legal relations r(R), whenever any two tuples t1
and t2 of r agree on the attributes , they also agree on the attributes . That
is,
• R(ABCD)
• FD:
– BA
– ADBC
– CABD
• Canonical Cover (Fc):
– BA
– ADC
– CBD
Keys SK, CK, PK
• R(ABCD)
– FD1: ABC
– FD2: ABC D, ABCD, ABCD
– FD3: BACD, ACDB
• Super key is the key that can uniquely identify any
record in a database
• Candidate Keys are super keys with the least
number of attributes. Any CK can not be proper
sub set of any other super keys.
– ABCD
– ABCD [here A is the subset of the super key AB]
Finding Candidate Keys
• R(ABCD)
– AB, BC, CA
• A(ABCD)
– ABCD, DA
• R(ABCDEF)
– ABC, CD, BAE
• R(ABCDE)
– ABCD, DA, BCDE
Prime and Non-Prime Attribute
• Prime Attribute: Member of candidate key
• Non-Prime Attribute: Attributes those are not
member of candidate key
Chapter 7: Functional Dependency
END OF LECTURE