关系可以具有不同长度的候选关键字吗? [英] Can a relation have Candidate Keys with different lengths?

查看:158
本文介绍了关系可以具有不同长度的候选关键字吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们在一个关系中可以有多个候选键.但是,我们可以在长度不同的关系中拥有两个候选键吗?

We can have more than one candidate key in a relation. But can we have two candidate keys in a relation different in length?

假设我有一个关系R(A,B,C,D,E),并且我们只有两组属性可以唯一标识关系中的元组:{A,B,C}和{D,E}

Suppose I have a relation R(A,B,C,D,E) and we have only two sets of attributes which uniquely identify a tuple in the relation: {A,B,C} and {D,E}.

那么我们可以说{A,B,C}和{D,E}都是候选键吗?

So can we say both {A,B,C} and {D,E} are candidate keys?

推荐答案

但是我们可以有两个长度不同的候选键吗?

But can we have two candidate keys in a relation different in length?

是的

CK(候选键)是不包含较小键的超键(唯一列集).

A CK (candidate key) is a superkey (unique column set) that doesn't contain a smaller one.

因此,我们有时会说CK是最小"超键,在这种意义上使用最小"意味着特定的超键无法通过删除属性而变成较小的超键.它不是意味着可能会想到的其他事情.特别是,它不是意味着其属性比其他任何CK少或没有比其他CK多的属性的CK.

So we sometimes say a CK is a "minimal" superkey, using "minimal" in this sense of a particular superkey not being able to be made into smaller superkey by removing attributes. It doesn't mean some other thing that might come to mind. In particular it doesn'tmean a CK that has fewer attributes than any other CK or no more attribtutes than another CK.

您需要学习技术术语的定义.名字什么都没告诉你.

You need to learn the definitions of technical terms. Names don't tell you anything.

也不必担心遵循定义时会注意到的事情.随便吧.

There's also no point in worrying about things you notice while following a definition. Just follow it.

假设我有一个关系R(A,B,C,D,E),而我们只有两组属性来唯一标识关系中的元组:{A,B,C}和{D,E}

Suppose I have a relation R(A,B,C,D,E) and we have only two sets of attributes which uniquely identify a tuple in the relation: {A,B,C} and {D,E}.

那是不可能的.如果{A,B,C}& {D,E}是唯一的,因此它们的所有超集也是唯一的.例如,所有属性的集合始终是唯一的,在这里{A,B,C,D,E}.

That is not possible. If {A,B,C} & {D,E} are unique, then all supersets of them are also unique. Eg the set of all attributes is always unique, here {A,B,C,D,E}.

大概是您的意思是,我们只有两个 minimum 个唯一标识一个元组的属性集",即只有两个 CKs .

Presumably what you mean is, we have only two minimal "sets of attributes which uniquely identify a tuple", ie only two CKs.

那么我们可以说ABC和DE都是候选密钥吗?

So can we say both ABC and DE are candidate keys?

如果这两个唯一集都不包含较小的唯一集,则可以.根据CK的定义.

You can if both those two unique sets don't contain smaller unique sets. By the definition of CK.

这篇关于关系可以具有不同长度的候选关键字吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆