Entity/Relationship Diagrams: example ID name address Students taking Course No.)( name teacher 6
6 Entity/Relationship Diagrams: example Students ID name address Course taking No. name teacher
Relationships Binary (relation between two entity sets) Multiway (relation between more than two entity sets) Multiplicity of relationships:Express the number of entities to which another entity can be associated via a relationship set. 7
7 Relationships Binary (relation between two entity sets) Multiway (relation between more than two entity sets) Multiplicity of relationships: Express the number of entities to which another entity can be associated via a relationship set
Binary Multiway Relationships ID name address Students TA Students 卡nros taking Course Course Assisting TA No.)( name teacher 8
8 Binary & Multiway Relationships Students ID name address Course taking No. name teacher TA Assisting Course Students TA Enrolls
Beers-Bars-Drinkers Example name )address license bars <Serves Frequents Beers Likes Drinkers name (manf name addr 9
9 Beers-Bars-Drinkers Example bars Beers Drinkers Serves Likes Frequents name address license name manf name addr
Example:3-Way Bar Dr inker Beer Relationship Joe's Bar Ann Miller Sue's Bar Ann Bud Sue's Bar Ann Pete's Ale Joe's Bar Bob Bud name addr Joe's Bar Bob Miller Joe's Bar Cal Miller Sue's Bar Cal Bud Lite license Bars name Suppose that drinkers will Beers only drink certain beers manf at certain bars. Preferences Our three binary relationships Likes, Sells,and Frequents name do not allow us to make this distinction. Drinkers But a 3-way addr 10 relationship would
10 Example: 3-Way Relationship Bars Beers Drinkers name name addr manf name addr license Preferences Suppose that drinkers will only drink certain beers at certain bars. Our three binary relationships Likes, Sells, and Frequents do not allow us to make this distinction. But a 3-way relationship would