A functional dependency is a constraint between two attributes or two sets of attributes. For any relation R, attribute B is functionally dependent on attribute A if, for every valid instance of A, that value of A uniquely determines the value of B. The functional dependency of B on A is represented by an arrow, A -> B. An attribute may be functionally dependent on two or more attributes, rather than on a single attribute. The attribute on the left-hand side of the arrow in a functional dependency is called the determinant. A candidate key is an attribute, or combination of attributes, that uniquely identifies a row in a relation. The properties are: Unique identification (which implies that each nonkey attribute is functionally dependent on that key) and nonredundacy (No attribute in the key can be deleted without destroying the property of unique identification).
THE BASIC NORMAL FORMS
A relation is in first normal form (1NF) if it contains no multivalued attributes, that is the value at the intersection of each row and column must be atomic.
A relation is in second normal form (2NF) if it is in the first
normal form and every nonkey attribute is functionally dependent on the
primary key. Thus no nonkey attribute is functionally dependent on
part (but not all) of the primary key. A relation that is in the
first normal form will be in the second normal form if:
1. The primary key consists of one attribute.
2. No nonkey attributes exist in the relation (thus
all of the attributes in the relation are components of the primary key).
3. Every nonkey attribute is functionally dependent
on the full set of primary key attributes.
A partial functional dependency is a functional dependency in which one or more nonkey attributes are functionally dependent on part (but not all) of the primary key.
A relation is in third normal form (3NF) if it is in the second normal form and no transitive dependencies exist. A transitive dependency in a relation is a functional dependency between two (or more) nonkey attributes. Example:
|
|
|||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
||||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|||
|
|
|
|
|
|
|||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|||||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
For more information on Normalization, click here: Normalization or Normalization or Normalization
Steps in Normalization
1. First Normal form. Any multivalued attributes
have been removed, so there is a single value (possibly null) at the intersection
of each row and column.
2. Second normal form. Any partial
dependencies have been removed
3. Third normal form. Any transitive
dependencies have been removed.
4. Boyce/Codd normal form. Any
remaining anomalies that result from functional dependencies have been
removed.
5. Fourth normal form. Any multivalued
dependencies have been removed.
6. Fifth normal form. Any remaining
anomalies have been removed.
| Table with multiplied attributes | |
| |--------------- | Remove multivalued attributes |
| First normal form | |
| |--------------- | Remove partial dependencies |
| Second normal form | |
| |--------------- | Remove transitive dependencies |
| Third normal form | |
| |--------------- | Remove remaining anomalies resulting from functional dependencies |
| Boyce-Codd normal form | |
| |--------------- | Remove multivalued dependencies |
| Fourth normal form | |
| |--------------- | Remove remaining anomalies |
| Fifth normal form |
Definition: A table (relation) is in 1NF if
1. There are no duplicated rows in the table.
2. Each cell is single-valued (i.e., there are no repeating groups or arrays).
3. Entries in a column (attribute, field) are of the same kind.
Note: The order of the rows is immaterial; the order of the columns is immaterial.
Note: The requirement that there be no duplicated rows in the table
means that the table has a key (although the key might be
made up of more than one column—even, possibly, of all the columns).
2nd Normal Form (2NF)
Definition: A table is in 2NF if it is in 1NF and if all non-key attributes are dependent on all of the key.
Note: Since a partial dependency occurs when a non-key attribute is
dependent on only a part of the (composite) key, the
definition of 2NF is sometimes phrased as, "A table is in 2NF if it
is in 1NF and if it has no partial dependencies."
3rd Normal Form (3NF)
Definition: A table is in 3NF if it is in 2NF and if it has no transitive dependencies.
Boyce-Codd Normal Form (BCNF)
Definition: A table is in BCNF if it is in 3NF and if every determinant is a candidate key.
4th Normal Form (4NF)
Definition: A table is in 4NF if it is in BCNF and if it has no multi-valued dependencies.
5th Normal Form (5NF)
Definition: A table is in 5NF, also called "Projection-Join Normal Form"
(PJNF), if it is in 4NF and if every join
dependency in the table is a consequence of the candidate keys of the
table.
|
|
|||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
||||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|||
|
|
|
|
|
||
|
|
|
|
|
|
|
|
|
|
|
|
|||||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|||||||
|
|
|
|
|
|
|
|
|
|
|
|
18 Oct.96
22 Apr 97 1 Oct 98 |
10:00
9:00 12:00 |
In good order Bathroom |
SG17 SG17 |
Beech
Ford Ford |
NZ31JGR
NS33HDR HTZ1HFR |
|
|
|
22 Apr 96
24 Oct 97 |
13:00
14:00 |
|
SG37 |
Ford
Beech |
NS33HDR
HTZ1HFR |
|
|
|||||||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Need Crockery |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
||||||||
|
|
|
|
|
|
|
Staff_No | SName | Car_Reg | |
|
|
6 Lawrence ST Glasgow |
|
|
|
|
|
|
|
|
|
|
|
|
|
9:00 |
|
|
|
|
|
|
|
|
|
|
|
|
|
HTZ1HFR | ||
|
|
|
|
|
|
|
|
|||
|
|
|
|
|
|
|
|