Normalization

資料庫正規化的目的在於減少重複的欄位,避免不正常的情況產生,進而增加效率。(Database Normalization is a technique for designing relational database tables to minimize duplication of information and, in so doing, to safeguard the database against certain types of logical or structural problems, namely data anomalies.)

First normal form

First normal form is that it does not allow duplicate rows or nulls. A table with unique key and without any nullable columns is in 1NF.

Second normal from
- Must in 1NF
- No Partial Dependency (Non-Primary Attributes have to full funtional dependency to primary key)
- In simple terms, a table is 2NF if it is in 1NF and all fields are dependent on the whole of the primary key, or a relation is in 2NF if it is in 1NF and every non-key attribute is fully dependent on each candidate key of the relation.

Third normal form
- Must in 2NF
- Every non-prime attribute of R is non-transitively dependent on every key of R. (i.e. Do not have X->Y, Y->Z , then X->Z)


Share this post!

Bookmark and Share

0 意見: