Normalization (15 09 2010)
Normalization (15 09 2010)
Normalization
Also,
any relation that is in BCNF, is in 3NF;
any relation in 3NF is in 2NF; and
any relation in 2NF is in 1NF.
Normalization
The benefit of higher normal forms is that update semantics for the affected
data are simplified.
This means that applications required to maintain the database are simpler.
A design that has a lower normal form than another design has more
redundancy. Uncontrolled redundancy can lead to data integrity problems.
Functional Dependencies
Functional Dependencies
We say an attribute, B, has a functional dependency on another attribute, A, if
for any two records, which have
the same value for A, then the values for B in these two records must be the
same. We illustrate this as:
AB
EmpEmail
EmpNum EmpEmail
EmployeeProject
ssn pnumber hours ename plocation
WORKS ON
Essn pno hours
Transitive dependency
Transitive dependency
DeptNum DeptName
InvNum InvDate
prod_no prod_desc.
2NF, but not in 3NF, nor in BCNF:
EmployeeDept
ename ssn bdate address dnumber dname
dnumber dname.
Third Normal Form
Third Normal Form
•A relation is in 3NF if the relation is in 1NF and all
determinants of non-key attributes are candidate keys
That is, for any functional dependency: X Y, where Y is a
non-key attribute (or a set of non-key attributes), X is a
candidate key.
•This definition of 3NF differs from BCNF only in the
specification of non-key attributes - 3NF is weaker than
BCNF. (BCNF requires all determinants to be candidate
keys.)
•A relation in 3NF will not have any transitive dependencies
of non-key attribute on a candidate key through another non-
key attribute.
Third Normal Form
Consider this Employee relation
Candidate keys
are? …
BC
NF
student_no instr_no
course_no instr_no