2. 指出下列关系模式是第几范式?并说明码 (1) R(X,Y,Z) F(XY->Z) (2) R(X,Y,Z) F(Y->Z,XZ->Y) (3) R(X,Y,Z) F(Y->Z,Y->X,X->Y,X->Z) (4) R(X,Y,Z) F(X->Y,X->Z) (5) R(X,Y,Z) F(X->Z,WX->Y)
时间: 2024-04-23 07:26:56 浏览: 20
(1) R(X,Y,Z) F(XY->Z) is in second normal form. X and Y together form a candidate key, and Z is fully dependent on XY.
(2) R(X,Y,Z) F(Y->Z,XZ->Y) is in third normal form. Y is a key, and there are transitive dependencies between Z and XZ, so the relation needs to be decomposed into two relations: R1(Y,Z) and R2(X,Y,Z).
(3) R(X,Y,Z) F(Y->Z,Y->X,X->Y,X->Z) is in BCNF. Each determinant of a functional dependency is a part of a candidate key, so there are no partial dependencies or transitive dependencies.
(4) R(X,Y,Z) F(X->Y,X->Z) is in second normal form. X is a candidate key, and Y and Z are fully dependent on X.
(5) R(X,Y,Z) F(X->Z,WX->Y) is in third normal form. X is a key, and there is a functional dependency between Z and X, so the relation needs to be decomposed into two relations: R1(X,Z) and R2(X,W,Y).