Functional Dependency
Functional Dependency
By,
JJ
Definition
• A functional dependency (FD) is a relationship
between two attributes, typically between the
PK and other non-key attributes within a table.
• For any relation R, attribute Y is functionally
dependent on attribute X (usually the PK), if for
every valid instance of X, that value of X
uniquely determines the value of Y.
• X ———–> Y
• Determinant, dependent
Examples
• SIN ———-> Name, Address, Birthdate
• SIN, Course ———> DateCompleted
• ISBN ———–> Title
Rules of Functional Dependencies
R(ABCDE)
Since the values of A are unique (a1, a2, a3,
etc.), it follows from the FD definition that:
• A → B, A → C, A → D, A → E
• It also follows that A →BC (or any other subset
of ABCDE).
• This can be summarized as A →BCDE.
• From our understanding of primary keys, A is a
primary key.
• Since the values of E are always the same (all
e1), it follows that:
• A → E, B → E, C → E, D → E
Other observations:
42 abc 17
43 pqr 18
44 xyz 18
• example,
• For example,
Example
42 abc CO 4
43 pqr EC 2
44 xyz IT 1
45 abc EC 2
example
• enrol_no → dept and dept → building_no,
Hence, according to the axiom of
transitivity, enrol_no → building_no is a valid
functional dependency.
• This is an indirect functional dependency,
hence called Transitive functional dependency.
references
• https://opentextbc.ca/dbdesign01/chapter/ch
apter-11-functional-dependencies
/
• https://www.geeksforgeeks.org/types-of-
functional-dependencies-in-dbms/#:~:text=A
%20functional%20dependency%20is
%20a,determining%20the%20value%20of
%20Y.