entity relationship diagrams objectives s learn the elements of the e-r model (entities, attributes,...
TRANSCRIPT
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
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
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)
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
Cardinality
The maximum and minimum number of entities that can occur on one side of the relationship.
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
Attributes
Attributes can be shown as ellipses or in lists--see figure 3-6
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
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
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