/
Chapter  Five: Data Modeling with the Entity-Relationship Model Chapter  Five: Data Modeling with the Entity-Relationship Model

Chapter Five: Data Modeling with the Entity-Relationship Model - PowerPoint Presentation

stefany-barnette
stefany-barnette . @stefany-barnette
Follow
342 views
Uploaded On 2019-12-29

Chapter Five: Data Modeling with the Entity-Relationship Model - PPT Presentation

Chapter Five Data Modeling with the EntityRelationship Model Chapter Objectives To understand the twophase data modelingdatabase design process To understand the purpose of the data modeling process ID: 771698

data entity dependent relationship entity data relationship dependent relationships understand strong model highline patterns entities modeling attributes design ii5

Share:

Link:

Embed:

Download Presentation from below link

Download Presentation The PPT/PDF document "Chapter Five: Data Modeling with the En..." is the property of its rightful owner. Permission is granted to download and print the materials on this web site for personal, non-commercial use only, and to display it on your personal computer provided you do not modify the materials and that you retain all copyright notices contained in the materials. By downloading content from our website, you accept the terms of this agreement.


Presentation Transcript

Chapter Five:Data Modeling with the Entity-Relationship Model

Chapter ObjectivesTo understand the two-phase data modeling/database design processTo understand the purpose of the data modeling processTo understand entity-relationship (E-R) diagramsTo be able to determine entities, attributes, and relationshipsTo be able to create entity identifiersTo be able to determine minimum and maximum cardinalities5-2

Chapter ObjectivesTo understand variations of the E-R modelTo understand and be able to use ID-dependent and other weak entitiesTo understand and be able to use supertype/subtype entitiesTo understand and be able to use strong entity patternsTo understand and be able to use the ID-dependent association patternTo understand and be able to use the ID-dependent multivalued attribute pattern5-3

Chapter ObjectivesTo understand and be able to use the ID-dependent archetype/instance patternTo understand and be able to use the line-item patternTo understand and be able to use the for-use-by patternTo understand and be able to use recursive patternsTo understand the iterative nature of the data modeling processTo be able to use the data modeling process5-4

The Data ModelA data model is a plan or blueprint for a database design.A data model is more generalized and abstract than a database design.It is easier to change a data model then it is to change a database design, so it is the appropriate place to work through conceptual database problems.5-5

Data Modeling in the SDLC5-6Data modeling occurs in the Requirements Analysis step of the SDLC The Systems development life cycle (SDLC) as discussed in Appendix B The final data model is part of the approved user requirements

Data Model = Conceptual DesignBooks on systems analysis and design often identify three design stages:Conceptual design (conceptual schema)Logical design (logical schema)Physical design (physical schema)The data model we are discussing is equivalent to the conceptual design as defined in these books.5-7

Entity-Relationship (E-R) ModelThe Entity-Relationship (E-R) model is a set of concepts and graphical symbols that can be used to create conceptual schemas.Versions:Original E-R model—by Peter Chen (1976)Extended E-R model—extensions to the Chen model Information Engineering (IE) — by James Martin (1990); uses “crow’s foot” notation, is easier to understand, and we will use it IDEF1X — a national standard developed by the National Institute of Standards and Technology [see Appendix C] Unified Modeling Language (UML) — by the Object Management Group; it supports object-oriented methodology [see Appendix D] 5- 8

EntitiesSomething that can be identified and the users want to track:Entity class—a collection of entities of a given typeEntity instance—the occurrence of a particular entityThere are usually many instances of an entity in an entity class. 5-9

CUSTOMER:The Entity Class and Two Entity Instances5-10

AttributesAttributes describe an entity’s characteristics.All entity instances of a given entity class have the same attributes, but vary in the values of those attributes.Originally shown in data models as ellipses.Data modeling products today commonly show attributes in rectangular form. 5-11

EMPLOYEE:Attributes in Ellipses5-12

EMPLOYEE:Attributes in Entity Rectangle5-13

IdentifiersIdentifiers are attributes that name, or identify, entity instances.The identifier of an entity instance consists of one or more of the entity’s attributes.Composite identifiers are identifiers that consist of two or more attributes.Identifiers in data models become keys in database designs.Entities have identifiers.Tables (or relations) have keys. 5-14 key

Entity Attribute Displayin Data Models5-15

RelationshipsEntities can be associated with one another in relationships:Relationship classes: associations among entity classesRelationship instances: associations among entity instancesIn the original E-R model, relationships could have attributes, but today this is no longer done.A relationship class can involve two or more entity classes. 5-16

Degree of the RelationshipThe degree of the relationship is the number of entity classes in the relationship:Two entities have a binary relationship of degree two.Three entities have a ternary relationship of degree three.5-17

Binary Relationship5-18

Ternary Relationship5-19

Entities and TablesThe principle difference between an entity and a table (relation) is that you can express a relationship between entities without using foreign keys.This makes it easier to work with entities in the early design process where the very existence of entities and the relationships between them is uncertain.5-20

CardinalityCardinality means “count,” and is expressed as a number.Maximum cardinality is the maximum number of entity instances that can participate in a relationship.Minimum cardinality is the minimum number of entity instances that must participate in a relationship.5- 21

Maximum CardinalityMaximum cardinality is the maximum number of entity instances that can participate in a relationship.There are three types of maximum cardinality:One-to-One [1:1]One-to-Many [1:N]Many-to-Many [N:M] 5-22 Its either 1 or many Side note : Minimum cardinality would be “optional” / 0 or 1 or More

The Three Types ofMaximum Cardinality5-23

HAS-A RelationshipsThe relationships we have been discussing are known as HAS-A relationships:Each entity instance has a relationship with another entity instance.An EMPLOYEE has one or more COMPUTERs.A COMPUTER has one assigned EMPLOYEE.5-24

Minimum CardinalityMinimum cardinality is the minimum number of entity instances that must participate in a relationship.Minimums are generally stated as either zero or one:IF zero [0] THEN participation in the relationship by the entity is optional, and no entity instance must participate in the relationship. IF one [1] THEN participation in the relationship by the entity is mandatory , and at least one entity instance must participate in the relationship. 5- 25

Indicating Minimum CardinalityAs shown in the examples in a following slide:Minimum cardinality of zero [0] indicating optional participation is indicated by placing an oval next to the optional entity.Minimum cardinality of one [1] indicating mandatory (required) participation is indicated by placing a vertical hash mark next to the required entity. 5- 26

The Three Types ofMinimum Cardinality5-27

Data Modeling Notation:IE Crow’s Foot 5-28Inside is min cardinalityOutside is max cardinality

Data Modeling Notation:IE Crow’s Foot 1:N5-290 or at most 1 Dept.

Data Modeling Notation:IE Crow’s Foot N:M5-30

ID-Dependent EntitiesAn ID-dependent entity is an entity (child) whose identifier includes the identifier of another entity (parent).The ID-dependent entity is a logical extension or subunit of the parent:BUILDING : APARTMENTPAINTING : PRINTThe minimum cardinality from the ID-dependent entity to the parent is always one.5-31

ID-Dependent Entities5-32

Weak EntitiesA weak entity is an entity whose existence depends upon another entity.All ID-Dependent entities are considered weak.There are also non-ID-dependent weak entities.The identifier of the parent does not appear in the identifier of the weak child entity. 5-33

Weak Entities5-34There’s no VIN in the Parent table

Identifying RelationshipsThe solid line connecting an ID-dependent entity and its parent is called an identifying relationship.The dashed line connecting strong entities or a non-ID-dependent weak entity to its parent is called a nonidentifying relationship. 5-35

ID-Dependent and Weak Entities5-36

Subtypes: Exclusive or Inclusive5-37discriminator

IE Crow’s Foot Symbol Summary I5-38

IE Crow’s Foot Symbol Summary II5-39Not required

Strong Entity Patterns:1:1 Strong Entity Relationships II5-40

Strong Entity Patterns:1:N Strong Entity Relationships II5-41

Strong Entity Patterns:1:N Strong Entity Relationships III5-42

Strong Entity Patterns:N:M Strong Entity Relationships II5-43

Strong Entity Patterns:N:M Strong Entity Relationships III5-44

ID-Dependent Relationships:The Association Pattern I5-45We added price here, making it dependent on the Part Name & Company Name

ID-Dependent Relationships:The Association Pattern II5-46 An entity that holds one or more additional attributes beyond the identifiers of the parent entities is called an associative entity (or association entity )─in this case Price is the additional attribute PartNumber and CompanyName are the identifiers of the parent entities, and are needed because QUOTATION is ID-dependent on both PART and COMPANY

ID-Dependent Relationships:The Multivalued Attribute Pattern II5-47

ID-Dependent Relationships:The Multivalued Attribute Pattern III5-48

ID-Dependent Relationships:Composite Multivalued Attributes I5-49

ID-Dependent Relationships:The Archetype/Instance Pattern II5-50

ID-Dependent Relationships:The Archetype/Instance Pattern III5-51

Mixed Patterns:The Line-Item Pattern I5-52

Mixed Patterns:The Line-Item Pattern II5-53

Mixed Patterns:Other Mixed Patterns5-54 IngredientName is the identifier of a strong entity INGREDIENT_USE is a multivalued composite group holding the ingredient list data Amount and Instructions are ID-dependent on RECIPE

Mixed Patterns:Other Mixed Patterns II5-55 Name (which will be added to EMPLOYEE_SKILL as a foreign key ) is the identifier of a strong entity EMPLYEE_SKILL is a multivalued composite group holding the list of skills for each employee ProficiencyLevel and CourseTaken are ID-dependent on EMPLOYEE

Mixed Patterns:The For-Use-By Pattern I5-56

Mixed Patterns:The For-Use-By Pattern II5-57

Recursive Patterns:1:N Recursive Relationship5-58 A recursive relationship occurs when an entity has a relationship to itself.

Recursive Patterns:N:M Recursive Relationship III5-59 FYI: a many to many may require an additional table. In MS Access to do a many-to-many they require it.

Highline UniversityCreating a Data Model5-60Suppose the administration at a hypothetical university named Highline University wants to create a database to track colleges, departments, faculty, and students .To do this, a data modeling team has collected a series of reports as part of its requirements determination .

Highline UniversityThe College Report5-61

Highline UniversityFirst Data Model5-62

Highline UniversityThe Department Report5-63

Highline UniversitySecond Data Model I5-64

Highline UniversitySecond Data Model II5-65

Highline UniversitySecond Data Model III5-66

Highline UniversitySecond Data Model IV5-67

Highline UniversityThe Department Student Report5-68

Highline UniversityThird Data Model5-69

Highline UniversitySample Student Acceptance Letter5-70

Highline UniversityFourth Data Model5-71

Highline UniversityFinal Data Model5-72

End of Presentation:Chapter Five5-73