数据库范式5nf_第五范式(5NF)| 数据库管理系统

数据库范式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.

关系R5NF当且仅当每一个不平凡的连接依赖于RR的候选键暗示。 分解为两个关系的关系必须包含无损连接属性,这可以确保在通过自然连接将关系再次连接在一起时,不会创建任何无效或多余的元组。

Properties:

特性:

A relation R with attributes, its values and tuples is in 5NF if and only if the following conditions are satisfied,

当且仅当满足以下条件时,带有属性,其值和元组的关系R的值为5NF

  1. The relation R should be already in 4NF.

    关系R应该已经在4NF中

  2. 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.

如果R1R2S上的连接等于关系R,那么我们可以说存在连接依赖关系,其中R1R2是给定关系的分解R1(P,Q,S)R2(Q,T) R(P,Q,S,T) 作为一种可能性,R1R2R的无损分解。

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.

考虑一个表,该表在三列中包含SubjectProfessorSemester的记录。

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,我们可以将其分解为三个关系,

SubjectProfessorSemester
Maths 2Saurav2
Data structureMadhurima3
AutomataAbhijeet5
Data structureSravan3
AutomataSushmita5
Computer networkKaran2
Digital logical designAbhijeet5
学科教授学期
数学2绍拉夫2
数据结构马杜里玛3
自动机阿比耶耶5
数据结构斯拉万3
自动机舒米塔5
计算机网络卡兰2
数字逻辑设计阿比耶耶5
SemesterSubject
2Maths 2
3Data structure
5Automata
2Computer network
5Digital logical design
学期学科
2数学2
3数据结构
5自动机
2计算机网络
5数字逻辑设计
SubjectProfessor
Maths 2Saurav
Data structureMadhurima
AutomataAbhijeet
Data structureSravan
AutomataSushmita
Computer networkKaran
Digital logical designAbhijeet
学科教授
数学2绍拉夫
数据结构马杜里玛
自动机阿比耶耶
数据结构斯拉万
自动机舒米塔
计算机网络卡兰
数字逻辑设计阿比耶耶
SemesterProfessor
2Saurav
3Madhurima
5Abhijeet
3Sravan
5Sushmita
2Karan
5Abhijeet
学期教授
2绍拉夫
3马杜里玛
5阿比耶耶
3斯拉万
5舒米塔
2卡兰
5阿比耶耶

翻译自: https://www.includehelp.com/dbms/fifth-normal-form-5nf-dbms.aspx

数据库范式5nf