entity relationship diagrams objectives s learn the elements of the e-r model (entities, attributes,...

10
Entity Relationship Diagrams Objectives Learn the Elements of the E-R model (entities, attributes, and relationships) Show how to apply the E-R model for modeling business situations To develop data modeling skills To interpret E-R diagrams

Upload: blanche-randall

Post on 29-Dec-2015

212 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Entity Relationship Diagrams Objectives s Learn the Elements of the E-R model (entities, attributes, and relationships) s Show how to apply the E-R model

Entity Relationship DiagramsObjectives

Learn the Elements of the E-R model (entities, attributes, and relationships)

Show how to apply the E-R model for modeling business situations

To develop data modeling skills To interpret E-R diagrams

Page 2: Entity Relationship Diagrams Objectives s Learn the Elements of the E-R model (entities, attributes, and relationships) s Show how to apply the E-R model

Entities

Entity is something that can be identified in the user’s work environment

Usually a noun Entities are grouped into classes or sets A particular entity is an instance of the entity

class Entities are usually depicted in an E-R diagram

as a rectangle with the Entity name in capital letters

Page 3: Entity Relationship Diagrams Objectives s Learn the Elements of the E-R model (entities, attributes, and relationships) s Show how to apply the E-R model

Attributes

Attributes (sometimes called properties) are characteristics that describe entities

Identifiers are attributes that describe an entity instance

Identifiers may be unique or non-unique Composite identifiers consist of two or more

attributes (ex: phone number: area code and number)

Page 4: Entity Relationship Diagrams Objectives s Learn the Elements of the E-R model (entities, attributes, and relationships) s Show how to apply the E-R model

Relationships

Relationships are associations between entities

Relationships are sometimes referred to as “Has-a” or “Is-a”

Three types of binary relationships– One to one– One to Many – Many to Many

Page 5: Entity Relationship Diagrams Objectives s Learn the Elements of the E-R model (entities, attributes, and relationships) s Show how to apply the E-R model

Cardinality

The maximum and minimum number of entities that can occur on one side of the relationship.

Page 6: Entity Relationship Diagrams Objectives s Learn the Elements of the E-R model (entities, attributes, and relationships) s Show how to apply the E-R model

Entity Relationship Diagrams

There are many diagramming conventions--based on CASE tools (several will be illustrated in class)

Entity--Capital letters in a rectangle Relationships--Diamonds Maximum Cardinality--inside the diamond Minimum Cardinality

– Hash mark to indicated entity must exist– Oval to indicate entity may or may not be required

Page 7: Entity Relationship Diagrams Objectives s Learn the Elements of the E-R model (entities, attributes, and relationships) s Show how to apply the E-R model

Attributes

Attributes can be shown as ellipses or in lists--see figure 3-6

Page 8: Entity Relationship Diagrams Objectives s Learn the Elements of the E-R model (entities, attributes, and relationships) s Show how to apply the E-R model

Weak Entities

A weak entity is sometimes called a dependent entity

A weak entity cannot exist without another type of entity exists

A special type of weak entity is an ID-dependent entity

See figure 3-7 for examples

Page 9: Entity Relationship Diagrams Objectives s Learn the Elements of the E-R model (entities, attributes, and relationships) s Show how to apply the E-R model

Subtype Entities

Some entities contain option sets of attributes or subtypes

Structures of subtypes and supertypes are called generalized hierarchies

The relationship is called a IS-A relationship Subtypes inherit from supertypes The subtypes may be mutually exclusive or not See figure 3-8

Page 10: Entity Relationship Diagrams Objectives s Learn the Elements of the E-R model (entities, attributes, and relationships) s Show how to apply the E-R model

Business Rules

Business Rules may or may not be included in an E-R diagram; depending on whether the application should enforce the business rules or the rules be enforced manually