entity / relationship diagrams objects entities classes entity sets attributes are like in odl....
TRANSCRIPT
![Page 1: Entity / Relationship Diagrams Objects entities Classes entity sets Attributes are like in ODL. Relationships: like in ODL except - not associated with](https://reader036.vdocument.in/reader036/viewer/2022082817/56649e215503460f94b0dac9/html5/thumbnails/1.jpg)
Entity / Relationship Diagrams
Objects entitiesClasses entity sets
Attributes are like in ODL.
Relationships: like in ODL except
- not associated with classes (I.e., first class citizens)
- not necessarily binary
Product
address
buys
![Page 2: Entity / Relationship Diagrams Objects entities Classes entity sets Attributes are like in ODL. Relationships: like in ODL except - not associated with](https://reader036.vdocument.in/reader036/viewer/2022082817/56649e215503460f94b0dac9/html5/thumbnails/2.jpg)
address name ssn
Person
buys
makes
employs
CompanyProduct
name category
stockprice
name
price
![Page 3: Entity / Relationship Diagrams Objects entities Classes entity sets Attributes are like in ODL. Relationships: like in ODL except - not associated with](https://reader036.vdocument.in/reader036/viewer/2022082817/56649e215503460f94b0dac9/html5/thumbnails/3.jpg)
Multi-way Relationships
Purchase
How do we model a purchase relationship between buyers,products and stores?
Product
Person
Store
![Page 4: Entity / Relationship Diagrams Objects entities Classes entity sets Attributes are like in ODL. Relationships: like in ODL except - not associated with](https://reader036.vdocument.in/reader036/viewer/2022082817/56649e215503460f94b0dac9/html5/thumbnails/4.jpg)
Roles in Relationships
Purchase
What if we need an entity set twice in one relationship?
Product
Person
Store
salesperson buyer
![Page 5: Entity / Relationship Diagrams Objects entities Classes entity sets Attributes are like in ODL. Relationships: like in ODL except - not associated with](https://reader036.vdocument.in/reader036/viewer/2022082817/56649e215503460f94b0dac9/html5/thumbnails/5.jpg)
Roles in Relationships
Purchase
Product
Person
Store
salesperson buyer
Note the multiplicity of the relationships: we cannot express all possibilities
![Page 6: Entity / Relationship Diagrams Objects entities Classes entity sets Attributes are like in ODL. Relationships: like in ODL except - not associated with](https://reader036.vdocument.in/reader036/viewer/2022082817/56649e215503460f94b0dac9/html5/thumbnails/6.jpg)
Attributes on Relationships
Purchase
Product
Person
Store
date
![Page 7: Entity / Relationship Diagrams Objects entities Classes entity sets Attributes are like in ODL. Relationships: like in ODL except - not associated with](https://reader036.vdocument.in/reader036/viewer/2022082817/56649e215503460f94b0dac9/html5/thumbnails/7.jpg)
Design Principles
PurchaseProduct Person
What’s wrong?
President PersonCountry
Moral: be faithful!
![Page 8: Entity / Relationship Diagrams Objects entities Classes entity sets Attributes are like in ODL. Relationships: like in ODL except - not associated with](https://reader036.vdocument.in/reader036/viewer/2022082817/56649e215503460f94b0dac9/html5/thumbnails/8.jpg)
What’s Wrong?
Purchase
Product
Store
date
personpersonAddr
Moral: don’t talk too much.
![Page 9: Entity / Relationship Diagrams Objects entities Classes entity sets Attributes are like in ODL. Relationships: like in ODL except - not associated with](https://reader036.vdocument.in/reader036/viewer/2022082817/56649e215503460f94b0dac9/html5/thumbnails/9.jpg)
What’s Wrong?
Purchase
Product
Person
Store
dateDates
Moral: don’t complicate life more than it already is.
![Page 10: Entity / Relationship Diagrams Objects entities Classes entity sets Attributes are like in ODL. Relationships: like in ODL except - not associated with](https://reader036.vdocument.in/reader036/viewer/2022082817/56649e215503460f94b0dac9/html5/thumbnails/10.jpg)
Do we really need 3-way relationships?
Purchase
Person
Store
Product
StoreOf
ProductOf
BuyerOf
Moral: Find a nice way to say things.