Normalization

Database design process

  • Gather user needs / business
  • Develop a needs-based ER Model user / business
  • Convert E-R model to the set of relations (tables)
  • Normalized relations, to remove anomalies
  • Implemented to create a database with a table for each relationship that is normalized

Database Normalization

  • Normalization process is the establishment of the database structure so that most of the ambiguity can be removed.
  • Normalization stage, starting from the most mild (1NF) to most stringent (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?

  • Optimizing table structures
  • Increase speed
  • The income data is the same
  • More efficient in the use of storage media
  • Reduce redundancy
  • Avoid anomalies (insertion anomalies, deletion anomalies, update anomalies).
  • Improved data integrity

Database Normalization (3)

  • A table saying good (efficient) or if the normal 3 to meet the following criteria:
    1. If there is decomposition (decomposition) table, it must be guaranteed safe that decomposition (Lossless-Join Decomposition). That is, after the table is described / to decomposition a new table-table, the table-table can generate a new table with the same exact.
    2. Maintain dependence on the functional changes in data (Dependency preservation).
    3. Does not 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 describes a relationship attributes in relation
  • An attribute said functionally dependant on the other, if we use the value attribute to determine the value of the other attributes.
  • Symbols are used à to represent the functional dependency.

à Read determine the functional

  • 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 A xà B
    It is the opposite of the previous notation.

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 – 1NF

A table on the form said to be normal I if did not reside in the un-normalized form of a table, where there is a kind of field multiplication and field that allows a null (empty)

Not to may:

  • Many attributes of value (Multi valued attributes).
  • Attributes composite or a combination of both.

So:

  • Price is the domain attribute must be atomic rates

Second Normal Form – 2NF

  • Normal form 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 dependence (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.
  • Functional dependency X à Y is full if it is said to delete an attribute A from X means that Y is no longer dependent functional.
  • Functional dependency X à Y said if deleting a partial attribute A from X means that Y is functionally dependent.

· Scheme of Relationship R in the form of 2NF if each every attribute of is non primary key A R hinge full of by functional at primary key R.

  • Tables in the following is fulfilling 1NF, but [do] not the inclusive of 2NF :

{NIM, KodeMk} NameMhs

{NIM, KodeMk} Address

{NIM, KodeMk} Matakuliah

{NIM, KodeMk} Sks

{NIM, KodeMk} LetterValue

Third Normal Form – 3NF

Normal form 3NF fulfilled 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

Table following students eligible 2NF, 3NF, but does not meet

Because the table above there is still non-primary key attribute (ie, Kota and Provinsi), which has a dependence on non-primary key attributes of the other (ie KodePos), namely:

KodePos > {Kota, Provinsi}

So that the table in the decomposition needs to be:

Mahasiswa (NIM, NamaMhs, Jalan, KodePos)

KodePos (KodePos, Provinsi, Kota)

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 First 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 adviser

Example

Seminar relation is a Third Normal Form, but not BCNF because Code Seminar is still dependent on the function adviser, if any adviser can only teach a seminar. Depending on the seminar is not a super key attributes such as required by BCNF. But relations Seminar should be parsed into two namely:

Normal form of the fourth and fifth

Relations in the fourth normal form (NF 4) if the relation in BCNF and dependency not 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 appears difficult to detect in practice.

Tinggalkan Balasan

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Ubah )

Twitter picture

You are commenting using your Twitter account. Log Out / Ubah )

Facebook photo

You are commenting using your Facebook account. Log Out / Ubah )

Connecting to %s


Ikuti

Get every new post delivered to your Inbox.