Example Suppose name beers name G is key for Beers Manf. Beer name is also key for Ales.In Ales color general,key at root is key for all. 26
26 Example beers Ales name Manf. color isa Suppose name is key for Beers Beer name is also key for Ales. In general, key at root is key for all
Example:A Multiattribute Key dept Rumber hours room course Possibly,hours+room also forms a key,but we have not designed it as such. 27
27 Example: A Multiattribute Key course dept number hours room Possibly, hours+room also forms a key, but we have not designed it as such
Weak Entity Sets Sometimes an E.S.E's key comes not (completely)from its own attributes,but from the keys of one or more E.S's to which E is linked by a supporting many-one relationship. 日 Called a weak E.S. ▣ Represented by putting double rectangle around E and a double diamond around each supporting relationship. 日 Many-one-ness of supporting relationship (includes 1-1) essential.With many-many,we would not know which entity provided the key value. 日 "Exactly one"also essential,or else we might not be able to extract key attributes by following the supporting relationship. 28
28 Weak Entity Sets Sometimes an E.S. E’s key comes not (completely) from its own attributes, but from the keys of one or more E.S’s to which E is linked by a supporting many-one relationship. Called a weak E.S. Represented by putting double rectangle around E and a double diamond around each supporting relationship. Many-one-ness of supporting relationship (includes 1-1) essential. With many-many, we would not know which entity provided the key value. “Exactly one ” also essential, or else we might not be able to extract key attributes by following the supporting relationship
Example of Weak Entity Sets 目 name is almost a key for football players,but there might be two with the same name. number is certainly not a key,since players on two teams could have the same number. But number,together with the team name related to the player by Plays- on should be unique. 29
29 Example of Weak Entity Sets name is almost a key for football players, but there might be two with the same name. number is certainly not a key, since players on two teams could have the same number. But number, together with the team name related to the player by Playson should be unique
In E/R Diagrams name number name Players Plays- Teams on (players)number and Note:must be rounded (teams)name is a key for Players because each player needs a team to help with the key. Double diamond for supporting many-one relationship Double rectangle for the weak entity set. 30
30 In E/R Diagrams Players Teams Plays- on name number name • Double diamond for supporting many-one relationship. • Double rectangle for the weak entity set. Note: must be rounded because each player needs a team to help with the key. (players) number and (teams) name is a key for Players