DATABASE DESIGN PROCESS (REVIEW)
- Gathering user or business requirement
- Developing E-R Model bases user or business requirements
- Convert E-R Model goes to relationship gatherings (table)
- Normalization is relationship to remove anomaly
- Implementation goes to database by make table for each relationship already most normalization
DATABASE NORMALIZATION
Normalization are process of base structure forming data so a considerable part ambiguity can be removed. Normalization phase is begun of lightest phase (1NF) until tightest (5NF) Just usually comes up with level 3NF or BCNF because was enough is equal to result qualified tables goodness.
Why done by normalization?
Optimizing is table structures
- Increasing speed
- Removing same data inclusion
- More efficient in storage media purpose
- Reducing redundancy
- Avoiding anomaly( insertion anomalies , deletion anomalies , anomalies update ).
- Increased data integrity
One table is said well (efficient) or normal if pock 3 criterions as follows:
- If there is decomposition table, therefore decomposition it shall be secured safe( Lossless Join Decomposition ). Its mean, after that table is untied / at decomposition becomes new tables, that new tables can result tables originally equally a hair breadth.
- It's petted dependable functional at the moment data change (Dependency Preservation).
- Don't breach Boyce Code Form Normal (BCNF).
If the third criterion (BCNF) can't be accomplished, therefore at least that table not breach the third phase Normal Form (3rd is Normal Form or 3NF).
FUNCTIONAL DEPENDENCY
Functional Dependency figuring relationship attributes in one relationship. An attribute is said functionally dependant on the other if we utilize to assess that attribute to determine the other attribute point.
Symbol that is utilized is for representing functional dependency. read functionally determines.
Notation: A --> B
A and B is attribute of one table. Matter functionally A determines B or B cling to A, if and only if available 2 data row with appreciative A same, therefore point B also same.
Notation: A -/-> B or A x -->B
Are opposite of previous notation.
Example FD (FUNCTIONAL DEPENDENCY)
Functional Dependency:
NRP --> Nama
Mata_Kuliah, NRP --> Nilai
Non Functional Dependency:
Mata_Kuliah --> NRP
NRP --> Nilai
Functional Dependency of point table
- NRP -->Nama
- {Mata_kuliah, NRP} -->Nilai
- Mata_kuliah -->NRP
- NRP -->Nilai
FIRST NORMAL FORM (First is
A table is said exist on normal form I if it don't exist on form un normalized table, where is happening multiplexing a sort field and enabling available field that null (empty).
Be not been allowed marks sense:
- Attribute that valuably there are many ( Multi valued attribute ).
- Attribute composite or combine of both.
So:
- domain price attribute shall constitute atomic price
- For example College Student Data as follows:
Or
Tables above are ineligible for 1NF
Decomposition becomes:
College Student table:
hobby table:
SECOND NORMAL FORM (second is
2NF normal form is accomplished in one table if have accomplished 1NF form, and all attribute besides primary key, as whole to have Functional Dependency on primary key. One table not accomplishes 2NF, if there is attribute which its dependency (Functional Dependency) just gets partial character only (just depend to one part of primary key.) If anything attribute that have no dependency for primary key, therefore that attribute has at move or is removed.
Functional dependency x --> Y. is said heaving full if erases A attribute of x matter y. no longer functional dependent. Functional dependency x --> Y. is said partial if erases A attribute of x matter y. still functional dependent. Relationship scheme r deep shaped 2NF if each attribute non primary key A Î R full dependent functionally on primary key R.
Example
Don't accomplish 2NF, since {NIM, KodeMk} one that is looked on as primary key whereas:
{NIM, KodeMk} --> NamaMhs
{NIM, KodeMk} --> Alamat
{NIM, KodeMk} --> Matakuliah
{NIM, KodeMk} --> Sks
{NIM, KodeMk} --> NilaiHuruf
That table needs at decomposition becomes many table that measures up 2NF
Functional dependency as follows:
- {NIM, KodeMk} --> NilaiHuruf (fd1)
- NIM --> {NamaMhs, Alamat} (fd2)
- KodeMk --> {Matakuliah, Sks} (fd3)
So
- fd1 (NIM, KodeMk, NilaiHuruf) --> Tabel Nilai
- fd2 (NIM, NamaMhs, Alamat) --> Tabel Mahasiswa
- fd3 (KodeMk, Matakuliah, Sks) --> Tabel MataKuliah
THIRD NORMAL FORM (Third is
3NF normal form is accomplished if have accomplished 2NF form, and if no attribute non primary key one that have dependency to attribute non primary key one that another( transitive dependency ).
Example
Following college student table this measures up 2NF, but doesn't accomplish 3NF.
Because is still exist attribute non primary key (namely
So that table needs at decomposition becomes:
College student( NIM , NamaMhs, Jalan, KodePos)
KodePos( KodePos , Provinsi,
BOYCE-COD NORMAL FORM (BNCF)
Boyce-Cod Normal Form have stronger compulsion of shaped the third
On example hereunder exists seminar relationship, Primary key is NPM + seminar. Student may take one or two seminar. Each seminar needs 2 counselors and each student led by one of between 2 that seminar counselor. Each counselor just may take one seminar just. on this example NPM and seminar points out a Counselor.
Seminar Relationship form is shaped the third Normal Form, but don't BCNF because seminar Code is still hinge function on Counselor, if each Counselor gets to teach just one seminar. Dependent seminar on one attribute is not super key as presupposed one by BCNF. Therefore seminar relationship shall be broken down as two which is:
FOURTH NORMAL FORM AND FIFTH
Relationship in shaped fourth normal from (4 NF) if relationship in BCNF and not meaty dependency a lot of point. To remove dependency there are many point of one relationship, we divide relationship become two new relationships. Each relationship contains two attributes that have relationship a lot of points.
Relationship in shaped fifth normal form (5NF) get business with property is join the so called without marks sense information loss (lossless join). fifth normal form (5 NF also so-called PJNF (projection join is form normal). This case very rare appearance and hard to be detected practically.
REFERENCES:
Ngurah Agus Sanjaya ER, S.KOM, M.KOM, Slide presentation : Normalization







