14 - FDs and Normalization Part-1
14 - FDs and Normalization Part-1
Dependencies
Let R be a relation and A & B be the sub-sets of
attributes of R, then B is said to be functionally
dependent on A if given A we can accurately
determine B.
If B is functionally dependent on A then it is
denoted as AB.
Example:
Emp_Project (Eid, EName, Proj_Name, Proj_No,
Proj_LOC, Hours)
The following FDs exists in above relation
1. Eid EName
Given Id of employee we can find the name
of the employee corresponding to that Id.
2. Proj_No Proj_Name, Proj_Loc
Given project number, we can find out the
project corresponding to that project number.
Similarly we can find project LOC from Proj_No.
3. {Eid, Proj_No} Hours
Given Employee Id and project number on
which an employee is working, we can find no of
hours worked by each employee on a particular
project.
4. EName -->< EId
EName does not functionally determine EId
because there may be two employees with the
same name.
Fully Functional Dependency
Let R be the relation then an attribute B is said to
be fully functionally dependent on attribute A if it
is functionally dependent on A and not
functionally dependent on any proper subset of A.
The following FD
{Eid, Proj_No, Proj_LOC} Hours, is not fully
functionally dependent on the set on the left hand
side because no of hours worked can also be
determined by a sub-set of set on left side of FD.
{Eid, Proj_No} Hours, Hour is now fully
functionally dependent on Eid and Proj_No
because neither Eid nor proj_No alone can
determine number of hours worked by employee.
Trivial Functional Dependency
Example,
Customer_name Customer_name
{Customer_name, loan_number}
Customer_name
Non-Trivial Functional
Dependency
An FD in which at least one attribute on right
hand side of FD is not contained in left side
attributes of FD
AB, where B is not a sub-set of A
Example
{Eid, Proj_No} Hours,
Here Hours is not a sub-set of {Eid, Proj_No}
NORMALIZATION
Alex 14 Maths
Stuart 17 Maths
Example of 1NF
Now, both the above tables qualifies for Second Normal Form
and will never suffer from Update Anomalies. Although there
are a few complex cases in which table in Second Normal Form
suffers Update Anomalies, and to handle those scenarios Third
Normal Form is there.
Example of 3NF
Third Normal form applies that every non-prime
attribute of table must be dependent on primary
key, or we can say that, there should not be the
case that a non-prime attribute is determined by
another non-prime attribute. So this transitive
functional dependency should be removed from the
table and also the table must be in Second
Normal form. For example, consider a table with
following fields.
Student_Detail Table :
www.studytonight.com/dbms/database-
normalization.php
www.tutorialspoint.com/dbms/pdf/
database_normalization.pdf
www.tutorialspoint.com/dbms/
dbms_storage_system.htm
www.tutorialcup.com/dbms/boyce-codd-normal-form.ht
m
Other Books.