Modeling Data in The Organization: Modern Database Management
Modeling Data in The Organization: Modern Database Management
Modeling Data in The Organization: Modern Database Management
Entity Attribute
symbols symbols
A special entity
that is also a Relationship
relationship symbols
Relationship
degrees specify
number of
entity types Relationship
involved cardinalities
specify how
many of each
entity type is
allowed
Chapter 2 Copyright © 2016 Pearson Education, Inc. 2-6
BUSINESS RULES
Unique
Readable
Repeatable
No
Chapter 2 primary key is specified.
Copyright © 2016 Pearson Education, Inc. 2-11
ENTITY-RELATIONSHIP MODEL
System System
user Inappropriate output
entities
Appropriate
entities
Required – must have a value for every Optional – may not have a value for
entity (or relationship) instance with every entity (or relationship) instance
which it is associated with which it is associated
The address is
broken into
component parts
Figure 2-8 Entity with multivalued attribute (Skill) and derived attribute
(Years Employed)
Multivalued Derived
an employee can Calculated
have more than one from date
skill employed
and current
date
Chapter 2 Copyright © 2016 Pearson Education, Inc. 2-23
IDENTIFIERS (KEYS)
The identifier
is boldfaced
and underlined
a) Relationship
type (Completes)
b) Relationship
instances
Entities of
One entity two different
related to types related Entities of three
another of to each other different types
the same
related to each
entity type
other
Chapter 2 Copyright © 2016 Pearson Education, Inc. 2-32
CARDINALITY OF RELATIONSHIPS
One-to-One
Each entity in the relationship will have exactly one
related entity
One-to-Many
An entity on one side of the relationship can have
many related entities, but an entity on the other
side will have a maximum of one related entity
Many-to-Many
Entitieson both sides of the relationship can have
many related entities on the other side
a) Unary relationships
b) Binary relationships
c) Ternary relationship
Maximum Cardinality
The maximum number
Chapter 2 Copyright © 2016 Pearson Education, Inc. 2-37
Figure 2-17 Examples of cardinality constraints
a) Mandatory cardinalities
c) Optional cardinalities
A person is
married to at most
one other person,
or may not be
married at all
simple
composite
The Assignment
Modeling time-dependent data has become associative entity shows
more important due to regulations such as the date range of a
HIPAA and Sarbanes-Oxley. product’s assignment to a
particular product line.
Chapter 2 Copyright © 2016 Pearson Education, Inc. 2-50
Figure 2-22
Data model for Pine
Valley Furniture
Company in
Microsoft Visio
notation
Different modeling
software tools may have
different notation for the
same constructs.