📜  门| GATE-CS-2015(Set 1)|第65章

📅  最后修改于: 2021-07-02 17:31:35             🧑  作者: Mango

考虑一个实体关系(ER)模型,其中实体集E1和E2通过m:n关系连接R 12 ,E1和E3通过1:n(在E1侧面为1且在n侧面为n E3)关系R 13

E1具有两个单值属性a 11和a 12 ,其中11是键属性。 E2具有两个单值属性a 21和a 22是键属性。 E3具有两个单值属性a 3132 ,其中31是键属性。关系没有任何属性。

如果关系模型是从上述ER模型派生的,则如果所有关系都在3NF中,则生成的最小关系数为___________。
(A) 2
(B) 3
(C) 4
(D) 5答案: (C)
解释:

Entity E1.
a1  a12
--------
a11 is key

Entity E2
a21  a22
--------
a22 is key

Entity E3
a31  a32
--------
a31 is key

R12 is m:n Relationship between E1 and E2
R12
a11     a22
-------------
(a11, a22) is key.


R13 is 1:n Relationship between E1 and E3
R13
a11   a31
-----------
(a11, a31) is key.


We need minimum no. of tables. 
Can we remove any of the above tables without 
loosing information and keeping the relations in 3NF?


We can combine R13 and R12 into one.  
a11   a31   a22
------------------
(a11, a31, a22) is key.


The relation is still in 3NF as for every functional 
dependency X -> A, one of the following holds
1) X is a superkey or
2) A-X is prime attribute 

这个问题的测验