NORMALIZATION
Database design process (review)
• Gathering user needs / business
• Develop the ER model based on user needs / business
• Convert ER Model to set the relation (table)
• Normalization to relations, to remove anomalies
• to implement the database for each table to create relationships that are normalization.
Database normalization (1)
• normalization process is the establishment of the database structure so that most of the ambiguity can be removed.
Goal normalization
- To reduce the complexity.
- To facilitate modification data.
• The process of normalization
- The data described in the form of a table, further analyzed based on specific requirements to some level.
- When a table has not been tested to meet specific requirements, the table must be parsed into a simple table to the form of the optimal
• The normalization stage starting from the light (1NF) to most stringent (5NF):
Form No Normal
The recurrence group
First Normal Form (1NF)
The dependence of part
Second Normal Form (2NF)
Eliminate transitive dependencies
Third Normal Form (3NF)
The anomaly-anomaly results from the functional dependence Normal Form of Boyce-Codd (BCNF) Eliminate dependence Multivalue
Fourth Normal Form (4NF)
The anomaly-anomaly remains
Fifth Normal Form (5NF)
• Usually only up to the level of 3NF or BCNF because already sufficient to generate the table-a table of good quality.
Database normalization (2)
• Why do normalization?
- Optimization table structures
- Increase the speed
- Eliminate income data the same
- More efficient use of storage media
- Reduce redundancy
- Avoiding anomalies (insertion anomalies, deletion anomalies, update anomalies).
- Improved data integrity
Database normalization (3)
• A table said good (efficient) or if the normal 3 to meet the following criteria:
- If there is decomposition (decomposition) table, it must be guaranteed safe dekomposisinya (Lossless-Join Decomposition). That is, after the table is described / didekomposisi a new table-table, the table-table can generate a new table with the same exact.
- Maintain the functional dependence on the change data (Dependency preservation).
- No violate Boyce-Code Normal Form (BCNF)
• If the three criteria (BCNF) can not be met, then at least the table does not violate the Normal Form of the third stage (3rd Normal Form / 3NF).
Functional Dependency (1)
• Functional Dependency attributes describe the relationship in a relationship
• An attribute said functionally dependant on the other, if we use the value attribute to determine the value of the other attributes.
• The symbol that is used to represent à functional dependency.
à reads determine the functional
Functional Dependency (2)
• notation: A à B
A and B are attributes of a table. A means of determining the functional B or B depends on A, if and only if there are 2 rows of data with the same value of A, then B is also the same value
• notation: A à B or B A xa
It is the opposite of the previous notation.
Functional DEPENDENCY (FD)
• Example:

Functional Dependency:
• NRP à Name
• Mata_Kuliah, NRP à Value
Non Functional Dependency:
• Mata_Kuliah à NRP
NRP à Value
Functional Dependency (4)
• Functional Dependency of the table value
- À Nrp Name
Because for each value Nrp the same, then the value of the same name
- (Mata_kuliah, NRP) à Value
Because the value of attributes depending on the NRP and Mata_kuliah together. In another sense Mata_kuliah for the NRP and the same, they also rated the same, because Mata_kuliah and the NRP is a key (is unique).
- Mata_kuliah à NRP
- NRP à Value
FIRST NORMAL FORM (First Normal Form – 1NF)
A table on the form said to be normal if I did not reside in the unnormalized form of a table, where there is a kind of field multiplication and field that allows a null (empty)
Not the diperboleh:
• Attribute values, many (Multivalued attributes).
• Attribute a composite or a combination of both.
So:
• Price is the domain attribute must be atomic rates
• Ex Student Data as follows:
Or
• Table-top table in the not eligible 1NF
Example (2)
• decomposition becomes:
• Student Table:
• Table Hobbies:
Second NORMAL FORM (Second Normal Form – 2NF) (1)
• The form of normal 2NF met in a table if it meets the form of 1NF, and all the attributes than the primary key, have a full Functional Dependency on primary key
• A table does not meet 2NF, if there are attributes that ketergantungannya (Functional Dependency) are only partial (only depending on the part of the primary key)
• If there are attributes that have no dependence on the primary key, then the attributes must be moved or removed
Second NORMAL FORM (Second Normal Form – 2NF) (2)
• functional dependence X à Y if it is said of a remove attribute A from X means that Y is no longer dependent functional.
• functional dependence X à Y if it is said partial delete an attribute A from X means that Y is functionally dependent.
• The scheme in the form of the relation R 2NF if every non-primary key attribute A Î R depend on the full primary key fungsioanl R.
Example (1)
The following table meet 1NF, 2NF, including but not
Example (2)
• Not meet 2NF, because (NIM, KodeMk) is regarded as the primary key:
(NIM, KodeMk) à NamaMhs
NIM (,) à KodeMk Address
(NIM, KodeMk) à Matakuliah
(NIM, KodeMk) à SKS
(NIM, KodeMk) à NilaiHuruf
• The table should be a few tables didekomposisi eligible 2NF
Example (3)
• Functional dependencynya as follows:
- (NIM, KodeMk) à NilaiHuruf (fd1)
- NIM à (NamaMhs, Address) (fd2)
- KodeMk à (Matakuliah, SKS) (fd3)
• So that:
- Fd1 (NIM, KodeMk, NilaiHuruf) à Table Value
- Fd2 (NIM, NamaMhs, Address) à Table Student
- Fd3 (KodeMk, Matakuliah, SKS) Table à MataKuliah
NORMAL FORM Third (Third Normal Form – 3NF) (1)
• The form of normal 3NF has been met if the form meets 2NF, and if there are no non-primary key attribute that has a dependence on non-primary key attributes of the other (transitive dependencies).
Example (1)
• Table the following students qualified 2NF, 3NF, but does not meet
• Because there are non-primary key attribute (ie, City and Provincial), which has a dependence on non-primary key attributes of the other (ie KodePos):
KodePos à (City, Province)
Example (2)
• So that the table should be didekomposisi:
• Students (NIM, NamaMhs, Road, KodePos)
- KodePos (KodePos, Province, City)
• Boyce-Codd Normal Form (BNCF)
Boyce-Codd Normal Form constraint has a stronger form of the Normal third. To be BNCF, relations must be in the form of Normal Kesatu and forced each of the attributes depends on the function in the super key attributes.
In the example below there is a relationship seminar, is the Primary Key NPM + Seminar.
Students may take one or two seminars. Each seminar requires 2 each of the students and led by one of the 2 seminar. Each leader can only take one seminar course. NPM in this example and show a Seminar Pembimbing.
Boyce-Codd Normal Form (BNCF)
Relations Seminar is a form of Third Normal, but not BCNF
Seminar Code because the function depends on the Pembimbing, if any Pembimbing can only teach a seminar. Seminar depend on one key attribute is not as super disayaratakan by BCNF. So
Seminar relations must be parsed into two namely:
Normal form of the fourth and fifth
• Relations in fourth normal form (NF 4) if the relation in BCNF and dependency tdak contain many values. To remove the dependency of many values from a relation, we divide the relationship into two new relations. Each relation contains two attributes that have a lot of relationship value.
• Relations in fifth normal form (5NF) deal with the property called the join without any loss of information (lossless join). Fifth normal form (also called the 5 NF PJNF (projection join normal form). The case is very rare and appear difficult to detect in practice.
