"minimality" 在数据库候选键中是什么意思?
What does the "minimality" mean in database candidate keys?
我的教授在研究候选密钥时给出的想法让我很困惑(但我觉得问他是假的 :p )
"no component of K can be eliminated without destroying
the uniqueness property --- minimality"
我在 wiki 上搜索它说
"there is no proper subset of these attributes for which (1) holds (which means that the set is minimal)." It also give an example but i don't understand.
所以我的问题是这里的"eliminated"是什么意思?如果这意味着删除整行数据,那么它应该始终保持数据的唯一性(因为您不能通过删除一行数据而失去唯一性)。如果只去掉K的单个属性,留下一行空"block",看起来很傻,会破坏数据。那么有人可以给我一些简单的例子来说明这个 属性 是什么意思吗?(可能一个代表好的,一个代表坏的)谢谢~
"Elimination"这里根本不涉及数据。这只是意味着您从密钥中删除了一个 attribute/column。如果减少的那组列仍然是一个键(即唯一标识任何数据行),那么之前的键不是最小的。
示例:
name id amount
A 1 1000
B 2 2000
C 3 1000
您可以使用 name
或 id
作为最小密钥。
您也可以使用 [name, id]
作为(复合、多列)键。但是那个键不是最小的(因为你可以从中删除一列并且仍然有一个键)。
列 amount
本身根本不构成键。
[amount, id]
将是一个关键,但同样,它不是最小的。
我的教授在研究候选密钥时给出的想法让我很困惑(但我觉得问他是假的 :p )
"no component of K can be eliminated without destroying the uniqueness property --- minimality"
我在 wiki 上搜索它说
"there is no proper subset of these attributes for which (1) holds (which means that the set is minimal)." It also give an example but i don't understand.
所以我的问题是这里的"eliminated"是什么意思?如果这意味着删除整行数据,那么它应该始终保持数据的唯一性(因为您不能通过删除一行数据而失去唯一性)。如果只去掉K的单个属性,留下一行空"block",看起来很傻,会破坏数据。那么有人可以给我一些简单的例子来说明这个 属性 是什么意思吗?(可能一个代表好的,一个代表坏的)谢谢~
"Elimination"这里根本不涉及数据。这只是意味着您从密钥中删除了一个 attribute/column。如果减少的那组列仍然是一个键(即唯一标识任何数据行),那么之前的键不是最小的。
示例:
name id amount
A 1 1000
B 2 2000
C 3 1000
您可以使用 name
或 id
作为最小密钥。
您也可以使用 [name, id]
作为(复合、多列)键。但是那个键不是最小的(因为你可以从中删除一列并且仍然有一个键)。
列 amount
本身根本不构成键。
[amount, id]
将是一个关键,但同样,它不是最小的。