數據庫范式5nf
Fifth normal form (5NF) is also known as project-join normal form (PJ/NF). It is designed to minimize redundancy in relational databases by separating semantically connected relationships in multiple formats to store multi-valued facts.
第五范式(5NF)也稱為投影聯合范式(PJ / NF) 。 它旨在通過以多種格式分隔語義連接的關系來存儲多值事實,以最大程度地減少關系數據庫中的冗余。
A relation R is in 5NF if and only if every non-trivial join dependency in R is implied by the candidate keys of R. A relation break up into two relations must contain lossless join Property, which makes certain that no invalid or extra tuples of attributes are created when relations are again joined together through a natural join.
關系R是5NF當且僅當每一個不平凡的連接依賴于R由R的候選鍵暗示。 分解為兩個關系的關系必須包含無損連接屬性,這可以確保在通過自然連接將關系再次連接在一起時,不會創建任何無效或多余的元組。
Properties:
特性:
A relation R with attributes, its values and tuples is in 5NF if and only if the following conditions are satisfied,
當且僅當滿足以下條件時,帶有屬性,其值和元組的關系R的值為5NF :
The relation R should be already in 4NF.
關系R應該已經在4NF中 。
The relation R cannot be additionally non loss decomposed (join dependency).
關系R不能另外進行非損耗分解(聯接依賴)。
If the relation or table can further decompose to remove redundancy and anomaly, and when the process of rejoining followed the decomposed tables through the means of candidate keys, we should not be losing the original data or any new record set should not arise. Understandably, joining two or more decomposed table should not lose records or create new records.
如果關系或表可以進一步分解以消除冗余和異常,并且當重新連接的過程通過候選鍵的方式遵循分解后的表時,我們不應丟失原始數據,也不應出現任何新的記錄集。 可以理解,聯接兩個或多個分解表不應丟失記錄或創建新記錄。
Join dependency
連接依賴
A table or relation can be recreated or re-designed by joining multiple tables and each table of this contain a subset of the attributes and values of the table, then the table is in Join Dependency. It is a generalization of Multivalued Dependency.
可以通過聯接多個表來重新創建或重新設計一個表或關系,并且該表或關系的每個表都包含該表的屬性和值的子集,然后該表處于聯接依賴關系中。 它是多值依賴關系的概括。
If the join of R1 and R2 over S is equal to relation R then we can say that a join dependency exists, where R1 and R2 are the decomposition R1 (P, Q, S) and R2 (Q, T) of a given relation R (P, Q, S, T). As a possibility, R1 and R2 are a lossless decomposition of R.
如果R1和R2在S上的連接等于關系R,那么我們可以說存在連接依賴關系,其中R1和R2是給定關系的分解R1(P,Q,S)和R2(Q,T) R(P,Q,S,T) 作為一種可能性,R1和R2是R的無損分解。
Over a relation R a Join Dependency ? {R1, R2, ..., Rn} is said to hold if R1, R2, ..., Rn is lossless-join decomposition. The *(P, Q, S, T), (S, T) will be a Join Dependency of R if the join of join's attribute is equal to the relation R. Here, *(R1, R2, R3) is used to specify that relation R1, R2, R3 and so on is a Join Dependency of R.
在關系R上 ,如果R1,R2,...,Rn是無損連接分解,則稱連接依賴項?{R1,R2,...,Rn}成立。 如果聯接屬性的聯接等于關系R ,則*(P,Q,S,T),(S,T)將是R的聯接依賴關系。 此處, *(R1,R2,R3)用于指定關系R1,R2,R3等是R的連接依賴關系。
Join Dependency can be associated to 5NF, wherein a relation is in 5NF, only if it is already in 4NF and it cannot be decomposed further.
Join Dependency可以與5NF相關聯,其中關系只有在5NF中且不能進一步分解的情況下才在5NF中 。
Contrarily,?in the case of functional dependencies, there is no sound and complete axiomatization for join dependencies, however, axiomatization exists for more expressive dependency languages such as full typed dependencies.
相反,在功能依賴關系的情況下,對于聯接依賴關系沒有完善的公理化方法,但是,對于更具表現力的依賴關系語言(例如全類型依賴關系)存在公理化方法。
On the other hand, the implication of join dependencies is decidable.
另一方面,聯接依賴的含義是可以確定的。
Example:
例:
Consider a table which contains a record of Subject, Professor and Semester in three columns.
考慮一個表,該表在三列中包含Subject , Professor和Semester的記錄。
The primary key is the combination of all three columns. Also take an account that the table is in 4NF, as long as there are no multivalued dependencies (2-part join dependencies) in the table: no column (which by itself is not a candidate key or a super key) is a determinant for the other two columns.
主鍵是所有三列的組合。 還應考慮到該表位于4NF中,只要該表中沒有多值依賴項(兩部分聯接依賴項):沒有列(其本身不是候選鍵或超級鍵)是其他兩列。
If the presence of any properly structured rule is not there to organize the three attributes of the table, it is important to structure them correctly by handling constraint.
如果沒有適當的結構化規則來組織表的三個屬性,則通過處理約束來正確構造它們很重要。
In the table, Data structure is taught by Madhurima and Sravan in semester 3, Automata by Abhijeet and Sushmita. In this case, the combination of all these fields required to identify valid data.
在表中,Madhurima和Sravan在第3學期講授了數據結構,Abhijeet和Sushmita講授了Automata。 在這種情況下,標識有效數據所需的所有這些字段的組合。
So to make the table into 5NF, we can decompose it into three relations,
因此,要使表格變為5NF,我們可以將其分解為三個關系,
Subject | Professor | Semester |
---|---|---|
Maths 2 | Saurav | 2 |
Data structure | Madhurima | 3 |
Automata | Abhijeet | 5 |
Data structure | Sravan | 3 |
Automata | Sushmita | 5 |
Computer network | Karan | 2 |
Digital logical design | Abhijeet | 5 |
學科 | 教授 | 學期 |
---|---|---|
數學2 | 紹拉夫 | 2 |
數據結構 | 馬杜里瑪 | 3 |
自動機 | 阿比耶耶 | 5 |
數據結構 | 斯拉萬 | 3 |
自動機 | 舒米塔 | 5 |
計算機網絡 | 卡蘭 | 2 |
數字邏輯設計 | 阿比耶耶 | 5 |
Semester | Subject |
---|---|
2 | Maths 2 |
3 | Data structure |
5 | Automata |
2 | Computer network |
5 | Digital logical design |
學期 | 學科 |
---|---|
2 | 數學2 |
3 | 數據結構 |
5 | 自動機 |
2 | 計算機網絡 |
5 | 數字邏輯設計 |
Subject | Professor |
---|---|
Maths 2 | Saurav |
Data structure | Madhurima |
Automata | Abhijeet |
Data structure | Sravan |
Automata | Sushmita |
Computer network | Karan |
Digital logical design | Abhijeet |
學科 | 教授 |
---|---|
數學2 | 紹拉夫 |
數據結構 | 馬杜里瑪 |
自動機 | 阿比耶耶 |
數據結構 | 斯拉萬 |
自動機 | 舒米塔 |
計算機網絡 | 卡蘭 |
數字邏輯設計 | 阿比耶耶 |
Semester | Professor |
---|---|
2 | Saurav |
3 | Madhurima |
5 | Abhijeet |
3 | Sravan |
5 | Sushmita |
2 | Karan |
5 | Abhijeet |
學期 | 教授 |
---|---|
2 | 紹拉夫 |
3 | 馬杜里瑪 |
5 | 阿比耶耶 |
3 | 斯拉萬 |
5 | 舒米塔 |
2 | 卡蘭 |
5 | 阿比耶耶 |
翻譯自: https://www.includehelp.com/dbms/fifth-normal-form-5nf-dbms.aspx
數據庫范式5nf