Professional Documents
Culture Documents
Number of Tables
Redundancy
– Third Normal Form (3NF)
Complexity
– Boyce-Codd Normal Form (BCNF)
– Fourth Normal Form (4NF)
– Fifth Normal Form (5NF)
– Domain Key Normal Form (DKNF)
Most
Mostdatabases
databasesshould
shouldbe
be3NF
3NFor
orBCNF
BCNFin inorder
orderto
toavoid
avoid
the
thedatabase
databaseanomalies.
anomalies.
DATABASE ANOMALIES
1NF
2NF
3NF
4NF
5NF
DKNF
Each
Eachhigher
higherlevel
levelisisaasubset
subsetof
ofthe
thelower
lowerlevel
level
First Normal Form (1NF)
A table is considered to be in 1NF if all the fields contain
only scalar values (as opposed to list of values).
Example (Not 1NF)
Author
Authorand
andAuPhone
AuPhonecolumns
columnsare
arenot
notscalar
scalar
1NF - Decomposition
1. Place all items that appear in the repeating group in a new table
2. Designate a primary key for each new table produced.
3. Duplicate in the new table the primary key of the table from
which the repeating group was extracted or vice versa.
Example (1NF)
0-55-123456-9 Main Street Small House 714-000-0000 $22.95 0-55-123456-9 Jones 123-333-3333
Example 1
EMP_DEPT_MAPPING Table:
EMP_ID EMP_DEPT_
NO
EMP_ID → EMP_COUNTRY
EMP_DEPT_No → { EMP_DEPT, DEPT_TYPE}
Candidate keys:
For the first table: EMP_ID
For the second table: EMP_DEPT
For the third table: {EMP_ID, EMP_DEPT}
Now, this is in BCNF because left side part of both the functional dependencies is a key.
Fourth Normal Form (4NF)
• A relation will be in 4NF if it is in Boyce Codd normal form and has no multi-
valued dependency.
• For a dependency A → B, if for a single value of A, multiple values of B
exists, then the relation will be a multi-valued dependency.
STU_ID COURSE HOBBY
21 Computer Dancing
21 Math Singing
21 Computer Dancing
21 Math Singing
STUDENT_COURSE STUDENT_HOBBY
STU_ID HOBBY
STU_ID COURSE
21 Dancing
21 Computer
21 Singing
21 Math