Purchase Product Person Store Can still model as a mathematical set (how ?)
14 Q : what does the arrow mean? A : if I know the store, person, invoice, I know the movie too Rental VideoStore Person Movie Invoice Arrows in Multiway Relationships
15 Q : what do these arrows mean? A : store, person, invoice determines movie and store, invoice, movie determines person Rental VideoStore Person Movie Invoice Arrows in Multiway Relationships
16 Q : how do I say: “invoice determines store” ? A : no good way; best approximation: Later: generalize this to functional dependencies Rental VideoStore Person Movie Invoice Arrows in Multiway Relationships
17 Roles in Relationships Purchase What if we need an entity set twice in one relationship? Product Person Store salesperson buyer Person
18 Roles in Relationships Purchase What if we need an entity set twice in one relationship? Product Person Store salesperson buyer
19 Attributes on Relationships Purchase Product Person Store date
20 Converting Multiway Relationships to Binary Purchase Person Store Product StoreOf ProductOf BuyerOf date
21 Relationships: Summary • Modeled as a mathematical set • Binary and multiway relationships • Converting a multiway one into many binary ones • Constraints on the degree of the relationship – many-one, one-one, many-many – limitations of arrows • Attributes of relationships – not necessary, but useful
22 Product name category price isa isa Educational Product Software Product Age Group platforms Subclasses in ER Diagrams
24 Subclasses in ER Diagrams • Assume subclasses form a tree. – I.e., no multiple inheritance. • Isa triangles indicate the subclass relationship. – Point to the superclass.
25 Example Beers Ales isa name manf color
26 ER Vs. Object Oriented Subclasses • In the object-oriented world, objects are in one class only. – Subclasses inherit properties from superclasses. • In contrast, E/R entities have components in all subclasses to which they belong. – Matters when we convert to relations.
27 Example Beers Ales isa name manf color Pete’s Ale
28 Constraints • A constraint = an assertion about the database that must be true at all times • Part of the database schema • Very important in database design
29 Modeling Constraints Finding constraints is part of the modeling process. Commonly used constraints: Keys: social security number uniquely identifies a person.
You've reached the end of your free preview.
Want to read all 57 pages?
- Fall '14
- Entity-relationship model, entity, Relational model, weak entity, Multiway Relationships