137k views
0 votes
We may think of relationships in the E/R model as having keys, just as entity sets do. Let R be a relationship among the entity sets E1, E2, …,En. Then a key for R is a set K of attributes chosen from the attributes of E1, E2,…, En such that if (e1,e2,…,en) and (f1,f2,…,fn) are two different tuples in the relationship set for R, then it is not possible that these tuples agree in all the attributes of K. Now, suppose n=2; that is, R is a binary relationship. Also, for each I, let Ki be a set of attributes that is a key for entity set Ei. In terms of E1 and E2, give a smallest possible key for R under the assumption that:_________.1. R is many-many

2. R is many-one from E1 to E2.
3. R is many-one from E2 to E1.
4. R is one-one.

User Redcayuga
by
4.7k points

1 Answer

2 votes

Step-by-step explanation:

1

R is many - many;

in this case we have that E1 is not what should be used to determine E2 and in this same way, W2 is not what should determine E1. So non of these can be a key on its own.

2.

R is many-one from E1 to E2

in this case there are 2 tuples (f1,f2) and (e1,e2) which have to be the same if they have the same key attribute for E1. All of them are the same so all the pairs are the same.

3.

R is many-one from E2 to E1:

the explanation for this is is almost the same with that of b. we apply the same logic. since for all keys, all pairs and sets are the same.

4.

R is one-one:

E1 is what determines E2 and likewise, E2 is what determines E1. irrespective of the key that is used, key K is going to the same value of n.

User Ankit Mahadik
by
5.0k points