Relationship Set The current "value"of an entity set is the set of entities that belong to it. Example:the set of all bars in our database. The "value"of a relationship is a relationship set,a set of tuples with one component for each related entity set. 11
11 Relationship Set The current “value ” of an entity set is the set of entities that belong to it. Example: the set of all bars in our database. The “value ” of a relationship is a relationship set, a set of tuples with one component for each related entity set
Multiplicity of Relationships Many-many Many-one One-one In a many-many relationship,an entity of either set can be connected to many entities of the other set.E.g.,a bar sells many beers;a beer is sold by many bars. In a many-one relationship,each entity of the first set is connected to at most one entity of the second set.But an entity of the second set can be connected to zero,one,or many entities of the first set. In a one-one relationship,each entity of either entity set is 12 related to at most one entity of the other set
12 Multiplicity of Relationships Many-many Many-one One-one • In a many-many relationship, an entity of either set can be connected to many entities of the other set. E.g., a bar sells many beers; a beer is sold by many bars. • In a many-one relationship, each entity of the first set is connected to at most one entity of the second set. But an entity of the second set can be connected to zero, one, or many entities of the first set. • In a one-one relationship, each entity of either entity set is related to at most one entity of the other set
Representing "Multiplicity 目 Show a many-one relationship by an arrow entering the "one"side. 目 Show a one-one relationship by arrows entering both entity sets. Rounded arrow "exactly one,"i.e., each entity of the first set is related to exactly one entity of the target set. 13
13 Representing “Multiplicity ” Show a many-one relationship by an arrow entering the “one ” side. Show a one-one relationship by arrows entering both entity sets. Rounded arrow = “exactly one, ” i.e., each entity of the first set is related to exactly one entity of the target set
Example: Many-One Relationship Drinkers Likes Beers Notice:two relationships connect the same entity Favorite sets,but are different. 14
14 Example: Many-One Relationship Drinkers Likes Beers Favorite Notice: two relationships connect the same entity sets, but are different
Example: One-One Relationship Manfs Best- Beers seller A beer is the best- A manufacturer has seller for 0 or 1 exactly one best manufacturer. seller. 15
15 Example: One-One Relationship Manfs Beers Best- seller A manufacturer has exactly one best seller. A beer is the bestseller for 0 or 1 manufacturer