oracle中dbms

To find the highest normal form of a relation, you have to first understand the basics of Functional dependency, Candidate keys, and Normal Forms.

查找关系的最高范式 ,您必须首先了解功能依赖项 ,候选键和范式的基础。

In relation, a Functional Dependency P holds Q (P->Q) if two tuples having similar values of attributes for P also have similar values of attributes for Q i.e. P distinctively decides Q.

相对地,如果具有相似属性值P的两个元组也具有相似属性值Q,P独特地决定Q ,则功能相关性P保持Q(P-> Q)

In a Database, Functional dependency performs assistance as a restriction between two sets of attributes.

在数据库中,功能依赖项作为辅助功能来限制两组属性。

A Candidate Key in a relation is a minimal set of attributes of which can be used to identify a tuple distinctively. A candidate key is a column or set of columns in a table or relation that can distinctly identify any database collection of record without indicating towards any other data. Each table may contain one or more candidate keys, but one candidate key is distinct in each table or relation, and it is called the primary key. The primary key is the best among the candidate keys which is usually used for identification.

关系中的候选关键字是属性的最小集合,可用于区别性地标识元组。 候选键是表或关系中的一列或一组列,它们可以清楚地标识记录的任何数据库集合,而无需指示其他任何数据。 每个表可以包含一个或多个候选键,但是一个候选键在每个表或关系中都不同,因此称为主键。 主密钥是通常用于标识的候选密钥中最好的。

The process of Normalization is to minimize redundancy from a database table or relation or a set of relations. Insertion, Deletion and Updation anomalies may cause by redundancy. So, it aids to reduce the redundancy in relations.

规范化的过程是最小化数据库表或关系或一组关系的冗余。 插入,删除和更新异常可能是由冗余引起的。 因此,它有助于减少关系中的冗余。

Normal forms are used to eliminate or minimize redundancy in database tables or relations. These Normal Forms are:

范式用于消除或最小化数据库表或关系中的冗余。 这些范式为:

  1. First Normal Form

    第一范式

  2. Second Normal Form

    第二范式

  3. Third Normal Form

    第三范式

  4. Boyce-Codd Normal Form (BCNF)

    博伊斯·科德范式(BCNF)

Steps to follow to find the highest normal form of a relation

查找关系的最高范式的步骤

  1. The first step is to find all feasible candidate keys of the relation and its attributes.

    第一步是找到该关系及其属性的所有可行候选键。

  2. The second step is to organize into two categories all the attributes of the relation:

    第二步是将关系的所有属性分为两类:

    1. Prime attributes
    2. Non-prime attributes
  3. Third and the last step is to examine to determine for 1st normal form and then 2nd and so on. If the process is unsuccessful in satisfying nth normal form condition, then the highest normal form will be n-1.

    第三步也是最后一步是检查确定第一个范式,然后确定第二个,依此类推。 如果该过程不能满足第n个范式条件,则最高范式将为n-1。

例子 (Examples)

Problem 1) Find the highest normal form of a relation R(P, Q, R, S, T) with Functional dependency set as (QR->S, PR->QT, Q->T).

问题1)找到功能依赖项设置为(QR-> S,PR-> QT,Q-> T)的关系R(P,Q,R,S,T)的最高范式。

Solution:

解:

Step 1:

第1步:

As the relation (PR)+ = (P, Q, R, S, T) is given, but not a single of its subset can determine all attributes of relation, So PR will be candidate key. P or R can’t be derived from any other attribute of the relation, so there will be only one candidate key (PR).

由于给出了关系(PR)+ =(P,Q,R,S,T),但没有一个子集可以确定关系的所有属性,因此PR将成为候选关键字。 P或R不能从关系的任何其他属性派生,因此将只有一个候选键(PR)。

Step 2:

第2步:

  1. The attributes which are part of candidate key (P, R) are Prime attributes.

    属于候选键(P,R)的属性是素数属性。

  2. The others will be non-prime attributes (Q, R, S).

    其他将是非素数属性(Q,R,S)。

Step 3:

第三步:

A Relational Database Management System does not enable multi-valued or composite attribute. So, the relation R(P, Q, R, S, T) is in 1st normal form.

关系数据库管理系统不启用多值或复合属性。 因此,关系R(P,Q,R,S,T)为第一范式。

Because QR->S is in 2nd normal form (QR is not a proper subset of candidate key PR) and PR->QT is in 2nd normal form (PR is candidate key) and Q->T is in 2nd normal form (Q is not a proper subset of candidate key PR).So, the relation is in 2nd normal form.

因为QR-> S为第二范式(QR不是候选关键字PR的适当子集),而PR-> QT为第二范式(PR为候选关键字),而Q-> T为第二范式(Q不是候选密钥PR的适当子集)。因此,该关系为第二范式。

Because in QR->S (neither QR is a super key nor S is a prime attribute) and in Q->T (neither Q is a super key nor T is a prime attribute) but to satisfy 3rd normal form, either LHS of a Functional Dependency should be super key or RHS should be prime attribute. So, the relation is not in 3rd normal form.

因为在QR-> S中(QR既不是超键也不是S是素数属性),而在Q-> T中(Q既不是超键也不是T是素数属性)但是要满足第三范式,所以LHS功能依赖关系应该是超级键,RHS应该是主要属性。 因此,该关系不是第三范式。

So, the highest normal form of relation will be 2nd Normal form.

因此,关系的最高范式将是第二范式。

Problem 2) Find the highest normal form of a relation R (P, Q, R, S, T) with Functional Dependency set (Q->P, P->R, QR->S, PR->QT).

问题2)找到具有功能相关性集(Q-> P,P-> R,QR-> S,PR-> QT)的关系R(P,Q,R,S,T)的最高范式。

Solution:

解:

Step 1:

第1步:

As the relation (PR) + = (P, Q, R, S, T) is given, Q will be a candidate key. Q can be derived from PR using PR->Q (Decomposing PR->QT to PR->Q and PR->T). So PR will be super key but (R) + ={R} and (P) + = {P, R, Q, S, T}. So P (subset of PR) will be a candidate key.

由于关系(PR)+ =(P,Q,R,S,T),Q将成为候选关键字。 可以使用PR-> Q(将PR-> QT分解为PR-> Q和PR-> T)从PR导出Q。 因此PR将是超级键,但(R)+ = {R}和(P)+ = {P,R,Q,S,T}。 因此,P(PR的子集)将成为候选关键字。

So there will be two candidate keys {P, Q}.

因此将有两个候选键{P,Q}。

Step 2:

第2步:

  1. The attributes which are part of candidate key (P, Q) are Prime attributes.

    属于候选键(P,Q)的属性是素数属性。

  2. The others will be non-prime attributes (R, S, T).

    其他将是非素数属性(R,S,T)。

Step 3:

第三步:

A Relational Database Management System does not enable multi-valued or composite attribute. So, the relation R (P, Q, R, S, T) is in 1st normal form.

关系数据库管理系统不启用多值或复合属性。 因此,关系R(P,Q,R,S,T)处于第一范式。

The relation is in 2nd normal form because Q->P is in 2nd normal form (Q is a super key) and P->R is in 2nd normal form (P is super key) and QR->S is in 2nd normal form (QR is a super key) and PR->QT is in 2nd normal form (PR is a super key).

该关系为第二范式,因为Q-> P为第二范式(Q为超级键),而P-> R为第二范式(P为超级键),而QR-> S为第二范式。 (QR是超级键),PR-> QT为第二范式(PR是超级键)。

Because LHS of all Functional Dependencies are super keys, the relation is in 3rd normal form.

因为所有功能依赖项的LHS都是超键,所以该关系为第三范式。

The relation is in BCNF as all LHS of all Functional Dependencies are super keys.

该关系在BCNF中,因为所有功能依赖项的所有LHS都是超级键。

So, the highest normal form is BCNF.

因此,最高范式是BCNF。

Problem 3) Find the highest normal form of a relation R (P, Q, R, S, T) with Functional Dependency set (P->S, Q->P, QR->S, PR->QT).

问题3)找到具有功能相关性集(P-> S,Q-> P,QR-> S,PR-> QT)的关系R(P,Q,R,S,T)的最高范式。

Solution:

解:

Step 1:

第1步:

As the relation (PR) + = (P, Q, R, S, T) is given, but not a single of its subset can determine all attributes of relation, so PR will be candidate key. P can be derived from Q, so we can replace P in PR by Q. So QR will also be a candidate key.

由于给出了关系(PR)+ =(P,Q,R,S,T),但是没有一个子集可以确定关系的所有属性,因此PR将成为候选关键字。 P可以从Q派生,所以我们可以用Q代替PR中的P。因此QR也是候选关键字。

So the two candidate keys will be (PR, QR).

因此,两个候选键将是(PR,QR)。

Step 2:

第2步:

  1. The attributes which are part of candidate key (P, Q, R) are Prime attributes.

    属于候选键(P,Q,R)的属性是素数属性。

  2. The others will be non-prime attributes (S, T).

    其他将是非素数属性(S,T)。

Step 3:

第三步:

A Relational Database Management System does not enable multi-valued or composite attribute. So, the relation R (P, Q, R, S, T) is in 1st normal form.

关系数据库管理系统不启用多值或复合属性。 因此,关系R(P,Q,R,S,T)处于第一范式。

Because P->S is partial dependency (P which is a subset of candidate key PR is determining non-prime attribute S), the relation is not in 2nd Normal form because the 2nd normal form does not enable partial dependency.

因为P-> S是部分依赖关系(作为候选键PR的子集的P正在确定非主要属性S),所以该关系不是第二范式,因为第二范式不允许部分依赖。

So, the highest normal form will be 1st Normal Form.

因此,最高范式将是第一范式。

翻译自: https://www.includehelp.com/dbms/how-to-find-the-highest-normal-form-of-a-relation.aspx

oracle中dbms

oracle中dbms_如何在DBMS中找到关系的最高范式?相关推荐

  1. oracle ioc图标,如何在PPT中导入ico格式的图标

    如何在PPT中导入ico格式的图标以下文字资料是由(历史新知网www.lishixinzhi.com)小编为大家搜集整理后发布的内容,让我们赶快一起来看一下吧! 如何在PPT中导入ico格式的图标 在 ...

  2. rxswift中hud_如何在RxSwift中运行测试

    rxswift中hud by Navdeep Singh 通过Navdeep Singh 如何在RxSwift中运行测试 (How to run tests in RxSwift) RxTest an ...

  3. ) php中_如何在webmin中配置多个PHP版本

    请关注本头条号,每天坚持更新原创干货技术文章. 如需学习视频,请在微信搜索公众号"智传网优"直接开始自助视频学习 1. 前言 如何在webmin中配置多个PHP版本?本教程将会给您 ...

  4. linux中original_如何在 Linux 中整理磁盘碎片

    如何在 Linux 中整理磁盘碎片 转载自: 如何在 Linux 中整理磁盘碎片​linux.cn 有一个神话是 linux 的磁盘从来不需要整理碎片.在大多数情况下这是真的,大多数因为是使用的是优秀 ...

  5. java中hashmap_HashMap如何在Java中工作

    java中hashmap 面试中最常见的问题是" HashMap如何在Java中工作"," HashMap的获取和放置方法如何在内部工作". 在这里,我试图通过 ...

  6. python中pow_如何在python中找到pow(a,b,c)的反向?

    pow(a,b,c) operator in python returns (a**b)%c . If I have values of b, c, and the result of this op ...

  7. java中iterator_如何在Java中读取CSV文件-Iterator和Decorator的案例研究

    java中iterator 在本文中,我将讨论如何使用Apache Common CSV读取CSV(逗号分隔值)文件. 从这个案例研究中,我们将学习如何在设计模式的上下文中使用Iterator和Dec ...

  8. python中knn_如何在python中从头开始构建knn

    python中knn k最近邻居 (k-Nearest Neighbors) k-Nearest Neighbors (KNN) is a supervised machine learning al ...

  9. wrapper在python中_virtualenvwrapper如何在python中安装虚拟环境?

    上一篇我们讲过virtualenv在python中的安装虚拟环境,它还有另一个小伙伴virtualenvwrapper.如果大家感兴趣的话,可以边学边分析两者的不同,接下来开始我们今天的讲解. 一.使 ...

最新文章

  1. MCSE2003学习之四
  2. 电子表单设计,表单打印,表单填写,数据发布,VC++,VB,源代码组件库
  3. CUDA在Windows下的软件开发环境搭建
  4. VTK:可视化之ShepardInterpolation
  5. Asp.Net MVC4入门指南(5):从控制器访问数据模型
  6. html访问java接口出现缓存_高可用架构设计(3) -电商商品详情页缓存背景及框架说明...
  7. python中wraps_【Python】Flask中@wraps的使用
  8. hibernate简单入门教程(四)---------关联映射
  9. C语言大数阶乘的求法
  10. ATITIT db perf enhs 数据库性能优化 目录 第一章 Cache类 1 第一节 查询cache 1 第二节 Update cache 2 第三节 内存表机制 零时表 2 第四节 雾
  11. 实践Hive的点点滴滴
  12. ios定位权限plist_[译] iOS 请求定位权限
  13. 炼石:栉风沐雨七载路,不负韶华再出发
  14. 关于jsp表单提交中action所指向Servlet路径问题的总结
  15. 解析2019年新零售社区团购发展方向
  16. 软件开发模型之迭代模型
  17. 剪枝计算机,α-β剪枝 - 电脑黑白棋 - 黑白棋天地
  18. 水的黏度 Viscosity of Water
  19. 浮点类型的比较,精度控制(float.h的利用 ,DBL_EPSILON)
  20. IBMMQ-安装IBMMQ服务端7.5(windows)

热门文章

  1. 你用计算机做过什么事情,他偷偷干了什么?(电脑)
  2. 【SpringBoot 2】(六)配置文件 web开发相关
  3. 使用 nvm 安装 nodejs 和 npm
  4. 【JUnit 报错】 method initializationerror not found:JUnit4单元测试报错问题
  5. 黑色30s高并发IIS设置
  6. 关Jquery判断input type=checkbox元素是否被选中的判断
  7. CC++中的qsort库函数
  8. 分析Linux文件rwx属性的含义
  9. 转:数字对讲机常识介绍
  10. Windows2003 企业版 + Sql Server2005手工调整数据库服务器内存