素数属性可以相互依赖吗?

时间:2021-01-19 14:11:08

I have a relation R{id, building, floor, sequence, capacity} where:

我有一个关系R{id, building, floor, sequence, capacity}其中:

(building,floor,sequence) -> id 
id -> (building,floor,sequence)
(building,floor,sequence) -> capacity
id -> capacity

It seems that this doesn't violate any normal form. However, is it really ok for id to depend on (building,floor,sequence) and vice versa even though id is the primary key? If no, what can be done?

这似乎没有违反任何正常形式。然而,即使id是主键,是否真的可以依赖(building、floor、sequence),反之亦然?如果没有,怎么办?

1 个解决方案

#1


2  

In any relation with multiple candidate keys, there'll inevitably be cyclic dependencies between them - since any candidate key can uniquely identify each tuple and each tuple has a value for each candidate key.

在任何与多个候选键的关系中,它们之间不可避免地会有循环依赖关系,因为任何候选键都可以唯一地标识每个元组,每个元组对每个候选键都有一个值。

The fact that one key is selected as being "more equal" than the others and named as the primary key is irrelevant. (When we're talking abstractly, as here. Certain database products may have features which do indeed make the primary key "more equal" than the alternate keys)

一个键被选择为“比其他键更平等”并命名为主键的事实是无关的。(当我们抽象地谈论时,就像这里。某些数据库产品可能具有使主键比备用键更“相等”的特性)

#1


2  

In any relation with multiple candidate keys, there'll inevitably be cyclic dependencies between them - since any candidate key can uniquely identify each tuple and each tuple has a value for each candidate key.

在任何与多个候选键的关系中,它们之间不可避免地会有循环依赖关系,因为任何候选键都可以唯一地标识每个元组,每个元组对每个候选键都有一个值。

The fact that one key is selected as being "more equal" than the others and named as the primary key is irrelevant. (When we're talking abstractly, as here. Certain database products may have features which do indeed make the primary key "more equal" than the alternate keys)

一个键被选择为“比其他键更平等”并命名为主键的事实是无关的。(当我们抽象地谈论时,就像这里。某些数据库产品可能具有使主键比备用键更“相等”的特性)