Ch02 - Modeling Data in The Organization
Ch02 - Modeling Data in The Organization
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, Ltd. 2-5
BUSINESS RULES (P.96)
requirements
Accompanied
Chapter 2 Copyright ©by
2016 diagrams
Pearson Education, Ltd. 2-9
ENTITIES (P.101)
Entity – a person, a place, an
object, an event, or a concept in
the user environment about which
the organization wishes to
maintain data
Entity type – a collection of
entities that share common
properties or characteristics
Entity instance – A single
occurrence of an entity type
Chapter 2 Copyright © 2016 Pearson Education, Ltd. 2-10
ENTITY TYPE AND ENTITY
INSTANCES
System System
user Inappropriate output
entities
Appropriate
entities
Names:
Definitions:
Singular noun
“An X is…”
Specific to
Describe unique
organization characteristics of each
instance
Concise, or
abbreviation
Explicit about what is
and is not the entity
For event entities,
the result not the
When an instance is
process created or destroyed
Name consistent for
Changes to other
all diagrams entity types
History that should be
Chapter 2
kept
Copyright © 2016 Pearson Education, Ltd. 2-16
ATTRIBUTES (P.105)
Attribute–property or
characteristic of an entity or
relationship type
Classifications of attributes:
Required versus Optional Attributes
Simple versus Composite Attribute
Single-Valued versus Multivalued
Attribute
Stored versus Derived Attributes
Identifier Attributes
Chapter 2 Copyright © 2016 Pearson Education, Ltd. 2-17
REQUIRED VS. OPTIONAL
ATTRIBUTES
Required – must have a value for Optional – may not have a value
every entity (or relationship) for every entity (or relationship)
instance with which it is associated instance 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 from date
one skill employed
and
current
Chapter 2 Copyright © 2016 Pearson Education, Ltd. date
2-20
IDENTIFIERS (KEYS) (P.107)
Identifier (Key)–an attribute (or
combination of attributes) that
uniquely identifies individual
instances of an entity type
Simple versus Composite Identifier
Candidate Identifier–an attribute
that could be an identifier…satisfies
the requirements for being an
identifier
Chapter 2 Copyright © 2016 Pearson Education, Ltd. 2-21
CRITERIA FOR IDENTIFIERS
Choose Identifiers that
Will not change in value
Will not be null
Avoid intelligent identifiers (e.g.,
containing locations or people
that might change)
Substitute new, simple keys for
long, composite keys
Chapter 2 Copyright © 2016 Pearson Education, Ltd. 2-22
Figure 2-9 Simple and composite identifier attributes
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, Ltd. 2-30
CARDINALITY OF RELATIONSHIPS (P.120)
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
Entities on both sides of the relationship
can have many related entities on the
other
Chapter 2 sideCopyright © 2016 Pearson Education, Ltd. 2-31
Figure 2-12 Examples of relationships of different degrees
a) Unary relationships
b) Binary relationships
c) Ternary relationship
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 associative entity
become more important due to shows the date range
regulations such as HIPAA and of a product’s
Sarbanes-Oxley.
assignment to a
particular product line.
Chapter 2 Copyright © 2016 Pearson Education, Ltd. 2-48
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.