Presentation is loading. Please wait.

Presentation is loading. Please wait.

Chapter Five Data Modeling with the Entity-Relationship Model.

Similar presentations


Presentation on theme: "Chapter Five Data Modeling with the Entity-Relationship Model."— Presentation transcript:

1 Chapter Five Data Modeling with the Entity-Relationship Model

2 The Data Model A data model is a plan, or blueprint, for a database design. It is more generalized & abstract than a database design. It is easier to change a conceptual data model than it is to change an implemented database design. Modeling is not easy You must abstract the important details of an organization.

3 Entity-Relationship Model
The ER model consists of a set of graphical symbols that are used to create conceptual models of databases. We’ll start with the very straightforward Chen model and then move to Erwin, preferred by our textbook

4 Entities Things that can be identified and that users want to track
Entity class — a collection of entities of a given type Entity instance — the occurrence of a particular entity There are usually many instances of an entity in an entity class. Entities translate into database tables.

5 Attributes Attributes are an entity’s characteristics.
All entity instances of a given entity class have the same attributes, but vary in the values of those attributes. Attributes may be Multivalued Derived Identifiers

6 EMPLOYEE Entity with Attributes

7 Identifiers Identifiers are attributes that uniquely identify entity instances. May be simple or composite. Identifiers in data models become keys in database implementations: Entities have identifiers. Tables (or relations) have keys. We often use the terms interchangeably.

8 Relationships Entities are associated with one another in relationships: Relationship classes: associations among entity classes Relationship instances: associations among entity instances A relationship class can involve one, two or more entity classes. Unary, binary, ternary etc.

9 Binary Relationship

10 Ternary Relationship PRESCRIPTION DOCTOR MEDICINE PATIENT

11 Relationship Cardinality
Maximum cardinality the maximum number of entity instances that can participate in a relationship with an instance of the related entity. 1-1, 1:M, M:N Minimum cardinality the minimum number of entity instances that must participate in a relationship with an instance of the related entity. 0 or 1, optional or mandatory

12 The Three Types of Maximum Cardinality

13 The Three Types of Minimum Cardinality

14 Data Modeling Notation

15 Data Modeling Notation: N:M and O-M
Book says that ERwin does not indicate minimum cardinalities on N:M relationships But, this gets the point across

16 ID-Dependent Entities
An ID-dependent entity is an entity whose identifier depends upon another entity. It’s composite. The ID-dependent entity is a logical extension of the other entity: BUILDING : APARTMENT PAINTING : PRINT The minimum cardinality from the ID-dependent entity is always one.

17 ID-Dependent Entities
A solid line indicates an identifying relationship

18 A dashed line indicates a nonidentifying relationship
Weak Entities A weak entity is an entity whose existence depends upon another entity. There is no specific notation for a nonidentifying but weak entity relationship A dashed line indicates a nonidentifying relationship

19 ID-Dependent and Weak Entities

20 Supertype & Subtype Entities
Supertypes/subtypes are used when an entity set has subsets that: have special attributes, or participate in special relationships Suppose the Employee entity contains 3 types of employees: Hourly have an hourly rate Salaried have annual salary & stock options Consultants have contract # & billing rate All Employees have ID#, Name, Phone, , Hire date

21 Supertype & Subtype Entities

22 Exclusive or Inclusive Subtypes
If subtypes are exclusive, one supertype relates to at most one subtype. Also called disjoint If subtypes are inclusive, one supertype can relate to one or more subtypes. Also called overlapping Also, some entity instances may not belong to any subtype. Discriminators are used in the to denote which subtype, if any, an instance is

23 Exclusive or Inclusive Subtypes examples

24 Subtypes denote “IS-A” relationships
Relationships connecting supertypes and subtypes are called IS-A relationships because a subtype IS A supertype. The identifer of the supertype and all of its subtypes must be identical Subtypes are used to avoid value-inappropriate nulls, and to model special relationships

25 ERwin Symbol Summary

26 ERwin Symbol Summary (Continued)

27 David M. Kroenke’s Database Processing Fundamentals, Design, and Implementation (10th Edition)
End of Presentation: Chapter Five Part One


Download ppt "Chapter Five Data Modeling with the Entity-Relationship Model."

Similar presentations


Ads by Google