首页  >  文章  >  数据库  >  DBMS 中的传递依赖

DBMS 中的传递依赖

WBOY
WBOY转载
2023-09-07 12:05:051074浏览

DBMS 中的传递依赖

什么是传递依赖

当间接关系导致函数依赖时,称为传递依赖。

如果 P -> Q 和 Q -> R 为真,那么 P-> R 是传递依赖。

要实现 3NF,消除传递依赖。

示例

Movie_ID

td>
Listing_ID

Listing_Type

DVD_Price ($)

M08

L09 >

犯罪

180 >

M03

M03

L05

戏剧

250

M05

L09

犯罪

180

上表不在3NF,因为它具有传递函数依赖 -

Movie_ID -> Listing_ID

Listing_ID -> Listing_Type

因此,以下具有传递函数依赖性。

Movie_ID -> Listing_Type

The above states the relation violates the 3rd Normal Form (3NF).

To remove the violation, you need to split the tables and remove the transitive functional dependency.

Movie_ID

Listing_ID

DVD_Price ($)

M08 L09 180

M03 L05 250

M05 L09 180

Listing_ID

Listing_Type

L09 Crime
L05 Drama
L09 Crime

Now the above relation is in Third Normal Form (3NF) of Normalization.

以上是DBMS 中的传递依赖的详细内容。更多信息请关注PHP中文网其他相关文章!

声明:
本文转载于:tutorialspoint.com。如有侵权,请联系admin@php.cn删除