Professional Documents
Culture Documents
Bamweyana Ivan
LSG: 2102
Relation Rules (Codd, 1970)
1. Only one value in each cell (intersection of row and
column)
2. All values in a column are about the same subject
3. Each row is unique
4. No significance in column sequence
5. No significance in row sequence
Normalisation
• Process of converting tables to conform to Codd’s
relational rules
• Split tables into new tables that can be joined at query
time
• The relational join
• Several levels of normalization
• Forms: 1NF, 2NF, 3NF, 4NF and 5NF.
• Normalization creates many “expensive” joins
Normalisation
• Database normalization is the process of organizing
the fields and tables of a relational database to
minimize redundancy and dependency.
• Normalization usually involves dividing large tables into
smaller (and less redundant) tables and defining
relationships between them.
• The objective is to isolate data so that additions, deletions,
and modifications of a field can be made in just one table
and then propagated through the rest of the database via
the defined relationships. (wikipedia)
Normalisation
• There are two goals of the normalization process:
eliminating redundant data (for example, storing the same data in
more than one table) and
ensuring data dependencies make sense (only storing related data
in a table).
Employee (1NF)
emp_no name dept_no dept_name skills
1 Kevin Jacobs 201 R&D C
1 Kevin Jacobs 201 R&D Perl
1 Kevin Jacobs 201 R&D Java
2 Barbara Jones 224 IT Linux
2 Barbara Jones 224 IT Mac
3 Jake Rivera 201 R&D DB2
3 Jake Rivera 201 R&D Oracle
3 Jake Rivera 201 R&D Java
2nd Normal Form
Each attribute must be functionally dependent
on the primary key.
• Functional dependence - the property of one or more attributes that
uniquely determines the value of other attributes.
• Any non-dependent attributes are moved into a smaller (subset) table.
2NF improves data integrity.
• Prevents update, insert, and delete anomalies.
Functional Dependence
Employee (1NF)
emp_no name dept_no dept_name skills
1 Kevin Jacobs 201 R&D C
1 Kevin Jacobs 201 R&D Perl
1 Kevin Jacobs 201 R&D Java
2 Barbara Jones 224 IT Linux
2 Barbara Jones 224 IT Mac
3 Jake Rivera 201 R&D DB2
3 Jake Rivera 201 R&D Oracle
3 Jake Rivera 201 R&D Java
• Insert Anomaly - adding new values. E.g., inserting a new department does not
require the primary key of emp_no to be added.
• Update Anomaly - multiple updates for a single name change causes
performance degradation. E.g., changing IT dept_name to IS
• Delete Anomaly - deleting wanted information. E.g., deleting the IT department
removes employee Barbara Jones from the database
This is the purpose of the 3NF – to maintain data integrity!
Third Normal Form (3NF)
Remove transitive dependencies.
• Derived dependency or Transitive dependence - two
separate entities exist within one table.
• Any transitive dependencies are moved into a smaller
(subset) table.
3NF further improves data integrity.
• Prevents update, insert, and delete anomalies.
Transitive Dependence
Employee (2NF)
emp_no name dept_no dept_name
1 Kevin Jacobs 201 R&D
2 Barbara Jones 224 IT
3 Jake Rivera 201 R&D
(emp_no -> dept_no , dept_no -> dept_name, thus emp_no -> dept_name)
• http://www.basicsofcomputer.com/modeling_repeating_gr
oups.htm
• ftp://ftp.cba.uri.edu/classes/horton/Class%20Notes/Lectur
e%20Notes%20-%20Chapter%205%20(part%202).doc