Download presentation
Presentation is loading. Please wait.
1
ER Modeling An E-R model is a conceptual (or logical) data model that includes –Entity (classes) –Attributes of each entity –Relationship types between entities –Constraints Types of attributes Designation of key attributes Cardinalities of relationship types An E-R Model is typically represented graphically –E-R diagram (many variants) –UML diagram
2
ER Notation ER notation originally from Chen –Many variations –Very abstract –Good for conceptual models –No connection to type of database All good stuff, but we’re not going to introduce the Chen notation in this class to because we will model in IDEF1X (to be covered in depth later).
3
Some IDEF1X notation Introduce some IDEF1X notation so we can draw some models. Still no connection to any specific type of database. Entities are boxes Attributes are listed in boxes, Keys at top Relationships are lines between entities Parent-to-Child relationships line with dot
4
Example 1 Draw an ER diagram for current rentals (videos and movies and customers)
5
Weak Entities A weak entity is –An entity with no key of its own –An entity whose instances cannot exist without being related to other entities An identifying relationship type is –A relationship type that determines the keys of the weak entities Weak entities in IDEF1X have rounded corners. Identifying relationships are solid lines, non- identifying are dotted lines
6
Previous Rentals Now let’s draw the ER diagram for Previous Rentals Videos can be previously rented many times, including by the same customer. What kind of key does it have?
7
Combined Rentals Why not just combine Current and Previous Rentals into one entity? DateDue and DateReturned can be a shared attribute
8
Surrogate Keys If in doubt about whether an entity is weak or not, why not just add an attribute (a number) that uniquely identifes each instance? MS Access will do this for us automatically – autonumber There are arguments for and against the use of surrogate keys, but the bottom line is you need to understand the problem with the model. If you just assume that a surrogate key will get added to each entity, then you probably won’t have an accurate model and it won’t help you understand the business needs.
9
Business Rules Business Rules define how a business operates. For instance, we may have a business rule that says a customer can only rent one video of a movie per day. Another example might be that R rated movies can only be rented by Customers over 18 Or each video is assigned a unique id as soon as it comes in from supplier.
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.