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

数据库范式5nf

Fourth normal form (4NF) is a normal form used in database normalization, in which there are no non-trivial multivalued dependencies except a candidate key. After Boyce–Codd normal form (BCNF), 4NF is the next level of normalization. Although the second, third, and Boyce–Codd normal forms operate with functional dependencies, 4NF is operated with a more universal type of dependency known as a multivalued dependency.

第四范式(4NF)是数据库规范化中使用的范式 ,其中没有除候选键之外的非平凡多值依赖项。 在Boyce-Codd范式(BCNF)之后,4NF是下一级别的规范化。 尽管第二,第三和Boyce-Codd范式具有功能依赖性,但4NF却具有更为通用的依赖性类型,即多值依赖性。

A table or relation is in 4NF if and only if, for each attribute of its non-trivial multivalued dependencies P→Q, P is a super key—that means, P is either a candidate key or a superset thence.

当且仅当表或关系对于其非平凡多值依赖项P→Q的每个属性,P是一个超级键,也就是说,P是一个候选键或一个父集,才在4NF中。

Properties:

特性:

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

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

  1. The relation or table should be in the Boyce-Codd Normal Form (BCNF).

    关系或表格应采用Boyce-Codd范式(BCNF)。

  2. The relation or table should not have any Multivalued Dependency.

    关系或表不应具有任何多值依赖关系。

A table which consists of a multivalued dependency breaches the normalization attainment of Fourth Normal Form (4NF) because it generates unneeded redundancies and can contribute to incompatible data which will not be inconsistency. To take this forward and up towards 4NF, it is important to divide this data and information into two tables or relations.

由多值依赖关系组成的表违反了第四范式(4NF)的归一化程度,因为它产生了不必要的冗余,并且可能导致不兼容的数据,并且不会造成不一致。 为了朝着4NF迈进,将这些数据和信息分成两个表或关系很重要。

Multivalued Dependency

多值依赖

Multivalued dependency takes place when there are one or more rows in a table or relation which indicates the existence of one or more other rows in the same table or relation. In another way, if we observe, two attributes (or columns) in a table or relation are not dependent on each other, but both of them depend on a third attribute. A multivalued dependency always needs a minimum of three attributes because it contains at least two attributes that are dependent on a third.

当表或关系中存在一个或多个行时,即表示同一表或关系中存在一个或多个其他行,则发生多值依赖。 用另一种方式,如果我们观察到,表或关系中的两个属性(或列)彼此不依赖,但是它们两者都依赖于第三个属性。 多值依赖项始终至少需要三个属性,因为它包含至少两个依赖于第三个属性。

For a Functional dependency in which P holds Q (P -> Q), if for a single value of P, multiple values of Q exists, then the table or relation may have a multi-valued dependency. The table or relation should contain minimally three attributes and Q and S should not be dependent for P ->> Q multivalued dependency.

对于其中P保持Q(P-> Q)的功能依赖关系,如果对于P的单个值,存在Q的多个值,则表或关系可能具有多值依赖关系。 该表或关系应至少包含三个属性,并且Q和S不应依赖于P->> Q多值依赖关系。

If the following points are satisfied, then a table or relation has a multivalued dependency,

如果满足以下几点,则表或关系具有多值依赖关系,

  1. In a table, for a Functional Dependency P which holds Q (P → Q), if for a single value of P, multiple value of Q exists, then the table may have multi-valued dependency.

    在一个表中,对于具有Q(P→Q)的功能依赖性P,如果对于P的单个值,存在Q的多个值,则该表可能具有多值依赖性。

  2. Also, the condition is that a table should have at-least three columns for it to have a multivalued dependency.

    同样,条件是一个表应至少具有三列,以使其具有多值依赖关系。

  3. And, for a relation R(P, Q, S), if there is a multi-valued dependency between P and Q, then Q and S should not be dependent on each other.

    并且,对于关系R(P,Q,S),如果在P和Q之间存在多值依赖关系,则Q和S不应相互依赖。

Example:

例:

Consider a database table which contain student Name, Hobby and subject,

考虑一个包含学生姓名,爱好和科目的数据库表,

NameHobbySubject
ArvindCricketMaths
SameerFootballScience
RajeevChessSocial science
SimranBadmintonEnglish
RajatSingingHindi
名称 爱好 学科
阿文德 蟋蟀 数学
沙美尔 足球 科学
拉杰夫 社会科学
西姆兰 羽毛球 英语
拉贾特 唱歌 印地语

In the above table, there is no connection between the columns of Hobby and Subject. They are both independent of each other.

在上表中,“爱好”和“主题”列之间没有任何联系。 它们彼此独立。

So there is a multivalued dependency, which assists towards unneeded repetition and redundancy of data and other anomalies as well.

因此,存在一个多值依赖关系,它也有助于不必要的重复和数据冗余以及其他异常。

To make the above relation satisfy with the fourth normal form condition and its properties, we can divide the table into two tables, which contain Name and Subject in one table and Name and Hobby in another table.

为了使上述关系满足第四范式条件及其属性,我们可以将表分为两个表,一个表中包含Name和Subject,另一表中包含Name和Hobby。

NameHobby
ArvindCricket
SameerFootball
RajeevChess
SimranBadminton
RajatSinging
名称 爱好
阿文德 蟋蟀
沙美尔 足球
拉杰夫
西姆兰 羽毛球
拉贾特 唱歌
NameSubject
ArvindMaths
SameerScience
RajeevSocial science
SimranEnglish
RajatHindi
名称 学科
阿文德 数学
沙美尔 科学
拉杰夫 社会科学
西姆兰 英语
拉贾特 印地语

Now, this relation satisfied the conditions of the fourth normal form.

现在,该关系满足第四范式的条件。

A table can also contain a functional dependency along with multi-valued dependency. In that case, the functionally dependent columns are transferred in a separate table and the multi-valued dependent columns are transferred to separate tables.

表还可以包含功能依赖项以及多值依赖项。 在这种情况下,功能相关的列将转移到单独的表中,多值相关的列将转移到单独的表中。

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

数据库范式5nf

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/news/543876.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

da---tlc5615._CD-DA的完整形式是什么?

da---tlc5615.CD-DA:光盘数字音频 (CD-DA: Compact Disc Digital Audio) CD-DA is an abbreviation of "Compact Disc Digital Audio". CD-DA是“光盘数字音频”的缩写 。 It is also known as Audio CD, is the established conventional format for au…

iti axi dsp_ITI的完整形式是什么?

iti axi dspITI:工业培训学院 (ITI: Industrial Training Institute) ITI is an abbreviation of the Industrial Training Institute. It offers training in engineering and non-engineering technical fields. It is a post-secondary school in India which is…

文本分析工具 数据科学_数据科学工具

文本分析工具 数据科学The Data Scientist is the "Sexiest job of 21 Century", by Harvard Business Review, however, what specifically will a data Scientist do, what tools do they use? 数据科学家是《哈佛商业评论》(Harvard Business Review)所说的“ 21…

appweb ejs_具有快速路线的EJS

appweb ejsHI! Welcome to NODE AND EJS TEMPLATE ENGINE SERIES. Today, we will see how we can work with EJS and routes? 嗨! 欢迎使用NODE和EJS模板引擎系列 。 今天,我们将看到如何使用EJS和路由? A route is like a sub domain wit…

数据分析 数据科学_数据科学中的数据分析

数据分析 数据科学资料剖析 (Data Profiling) Data Profiling is a method of examining data from an existing supply and summarizing info this data. Your profile data to work out the accuracy, completeness, and validity of your data. Information identification …

bpl开发模式_BPL的完整形式是什么? 什么是电力线宽带

bpl开发模式BPL:电力线宽带 (BPL: Broadband Over Power Lines) BPL is an abbreviation of "Broadband Over Power Lines". BPL是“电力线宽带”的缩写 。 BPL is also occasionally called as Internet over power line (IPL) or power line telecommu…

ups一直响是什么原因_UPS的完整形式是什么?

ups一直响是什么原因UPS:不间断电源 (UPS: Uninterruptible Power Supply) UPS is an abbreviation of Uninterruptible Power Supply. It operates with the support of a battery which is used to supply power in the lack of most important source or when th…

语音asr是什么意思_ASR的完整形式是什么?

语音asr是什么意思ASR:自动语音识别 (ASR: Automated Speech Recognition) ASR stands for Automated Speech Recognition. With the help of this technology, spoken words can be easily converted to written text. What actually it does? It gives access to…

数据库缓冲池_块缓冲| 数据库管理系统

数据库缓冲池When several blocks need to be transferred from disk to main memory and all the block addresses are known, several buffers can be reserved in main memory to speed up the transfer. 当需要将几个块从磁盘传输到主存储器并且所有块地址已知时&#xff0…

python公共变量_Python中的公共变量

python公共变量By default all numbers, methods, variables of the class are public in the Python programming language; we can access them outside of the class using the object name. 默认情况下,该类的所有数字,方法和变量在Python编程语言中…

递归如何书写?

目录 第一步:首先你分析问题,要有递归的思路,知道要递归什么来解决问题。 第二步:先按照思路(第一层)写出函数的定义与函数体 第三步:根据函数的定义与函数体进一步确定需要的参数 第四步&a…

kotlin 判断数字_Kotlin程序可以逆转数字

kotlin 判断数字Given an integer number, we have to find reverse number and print it. 给定一个整数,我们必须找到反向数字并打印出来。 Example: 例: Input:Number: 12345Output:Reverse Number: 54321To find a reverse number – we use this f…

Python | 创建员工类别

Python-员工类代码 (Python - employee class code) # employee class code in Python# class definitionclass Employee:__id0__name""__gender""__city""__salary0# function to set data def setData(self,id,name,gender,city,salary):self.…

scala 字段覆盖_Scala中的字段覆盖

scala 字段覆盖Scala字段覆盖 (Scala field overriding) Overriding is the concept in which the child class is allowed to redefine the members of the parent class. Both methods and variables/ fields can be overridden in object-oriented programming. In Scala as…

python 散点图 分类_Python | 分类图

python 散点图 分类Visualizing different variables is also a part of basic plotting. Such variables can have different classes, for example, numerical or a category. Matplotlib has an important feature of Categorical Plotting. We can plot multiple categoric…

python 对角线矩阵_Python | 矩阵的对角线

python 对角线矩阵Some problems in linear algebra are mainly concerned with diagonal elements of the matrix. For this purpose, we have a predefined function numpy.diag(a) in NumPy library package which automatically stores diagonal elements in an array (a V…

二叉树祖先节点_二叉树的祖先

二叉树祖先节点Problem statement: 问题陈述: Given a Binary Tree and a target key, write a function that prints all the ancestors of the key in the given binary tree. 给定二叉树和目标键,编写一个函数,以打印给定二叉树中键的所有…

txt文本变为粗体_如何在PHP中使文本变为粗体?

txt文本变为粗体Sometimes we might want to display text with style. That its font, color, make it bold, italic, underlined and many more. Adding whatever style is all based on the message that we want to pass across or getting someones attention. 有时我们可…

CALayer精讲

CALayer精讲 CALayer包含在QuartzCore框架中,这是一个跨平台的框架,既可以用在iOS中又可以用在Mac OS X中。后面要学Core Animation就应该先学好Layer(层)。 我们看一下UIView与Layer之间的关系图(图片来源于网络&…

VSRE的完整形式是什么?

VSRE:预期回复非常短 (VSRE: Very Short Reply Expected) VSRE is an abbreviation of "Very Short Reply Expected". VSRE是“ Very Short Reply Expected”的缩写。 It is an expression, which is commonly used in the Gmail platform. It is writte…