给定与FDs的关系,计算属性集合的闭包

时间:2022-10-04 10:06:24

Consider the relation schema R = ABCDG with following functional dependencies (FD)

考虑具有以下功能依赖性的关系模式R = ABCDG (FD)

AB  -> C
C   -> A
BC  -> D
ACD -> D
D   -> EG
BE  -> C
CG  -> BD
CE  -> AG

Compute closure of BD and CA.

计算BD和CA的闭包。

How we can find them?

我们怎样才能找到它们呢?

1 个解决方案

#1


2  

The closure of a set of functional dependencies, F, means all the functional dependencies logically implied by F. For example, given

一组函数依赖项F的闭包,表示F逻辑上隐含的所有函数依赖项,例如给定的

  • BC -> D, and
  • BC - > D,
  • D -> EG
  • D - >如

we can apply Armstrong's axioms to derive

我们可以用阿姆斯特朗的公理来推导

  • D -> E,
  • D - > E,
  • D -> G,
  • D - > G,
  • BC -> E,
  • BC - > E,
  • BC -> G,
  • G BC - >,

and so on.

等等。

When you've derived every FD implied by F, you have the closure of F with respect to R. In your case, you want to derive every FD logically implied by BD and CA.

当你推导出F包含的所有FD时,你就得到了F关于r的闭包在你的例子中,你想要推导出BD和CA逻辑上隐含的所有FD。

As far as I know, every textbook on relational database theory includes one or more algorithms to compute the closure of a set of functional dependencies. Your best bet is to follow one of the algorithms in your textbook, if you have one.

据我所知,关于关系数据库理论的每一本教科书都包含一个或多个算法来计算一组函数依赖项的闭包。如果你有教科书里的算法,你最好遵循其中的一个。

#1


2  

The closure of a set of functional dependencies, F, means all the functional dependencies logically implied by F. For example, given

一组函数依赖项F的闭包,表示F逻辑上隐含的所有函数依赖项,例如给定的

  • BC -> D, and
  • BC - > D,
  • D -> EG
  • D - >如

we can apply Armstrong's axioms to derive

我们可以用阿姆斯特朗的公理来推导

  • D -> E,
  • D - > E,
  • D -> G,
  • D - > G,
  • BC -> E,
  • BC - > E,
  • BC -> G,
  • G BC - >,

and so on.

等等。

When you've derived every FD implied by F, you have the closure of F with respect to R. In your case, you want to derive every FD logically implied by BD and CA.

当你推导出F包含的所有FD时,你就得到了F关于r的闭包在你的例子中,你想要推导出BD和CA逻辑上隐含的所有FD。

As far as I know, every textbook on relational database theory includes one or more algorithms to compute the closure of a set of functional dependencies. Your best bet is to follow one of the algorithms in your textbook, if you have one.

据我所知,关于关系数据库理论的每一本教科书都包含一个或多个算法来计算一组函数依赖项的闭包。如果你有教科书里的算法,你最好遵循其中的一个。