DBMS 中的传递依赖

来源:这里教程网 时间:2026-02-28 17:19:20 作者:

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.

相关推荐