(1) Functional Dependency
an attribute determines other attribute's value
eg:
Full FD:
(studentID) determine (studentName)
Partially FD:
(studentID,studentName) determine (score)
(2) Key
Student(stuID,name,HKID,sex,score)
Superkey: 一系列屬性
eg:(stuID),(HKID),(stuID,HKID),(stuID,HKID,name)....
These superkeys can determine the identity.
Key: minimal supterkey 最小的superkey
eg:(stuID),(HKID)
Candidate Key: 沒有多餘屬性
eg:(stuID),(HKID),(name)
Primary Key: 主鍵
Secondary Key: Candidate Key中除了PK
(3) 1NF
First normal form
only have simple value
一個屬性不可有多值+無重複列
Problem:
Solution:
(4) 2NF
every non-prime attribute is fully FD on the PK
清除部分依賴 應該完全依賴 (僅一個PK)
Problem:
Solution:
變爲2NF 也是3NF
(5) 3NF
No non-prime attribute is transitively dependent on the PK
沒有傳遞依賴關係
Problem:
傳遞依賴
Solution: