Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
ORGANIZATION
Conceptual Data Modeling
Entity Relationship Diagrams
OBJECTIVES
BUSINESS RULES
Readable
Repeatable
DATA DEFINITIONS
Attributes
Relationships
Attribute
symbols
Relationship
symbols
Relationship
cardinalities
specify how
many of each
entity type is
allowed
7
ENTITIES
10
AN ENTITY
SHOULD BE:
11
Inappropriate
entities
System
output
Appropriate
entities
12
ATTRIBUTES
Classifications of attributes
13
14
Figure 2-8 Entity with multivalued attribute {Skill} and derived attribute
[Years Employed]
Multivalued
An employee can
have more than
one skill
Derived
Calculated
from Date
Employed
and
Current
Date
16
IDENTIFIER ATTRIBUTE
The identifier
is boldfaced
and underlined
Components of
a composite
identifier is
boldfaced only
18
NAMING ATTRIBUTES
DEFINING ATTRIBUTES
21
MODELING RELATIONSHIPS
b)
Relationship
instances
Relationships
have a verb
phrase
name in
present tense
You can name
a relationship
in each
23
Weak entity
Identifying relationship
Strong entity
Weak entity
EMPLOYEE
Employee ID
Employee Name
Carries
Dependent SSN
Dependent Name
(First Name, Middle
Initial, Last Name)
Date of Birth
DEGREE OF A RELATIONSHIP
28
One entity is
related to
itself
Entities of
two different
types are
related to
each other
Entities of three
different types
are related to
each other
29
CARDINALITY OF A
RELATIONSHIP
The maximum number of instances of one
One-to-One
One-to-Many
Many-to-Many
30
31
32
CARDINALITY CONSTRAINTS
34
Relationsh
ip with
cardinality
constraint
s
DVD is an optional participant in a relationship with MOVIE (i.e. DVD is
optional for MOVIE). That is, there can be an instance of MOVIE without
any related instance of DVD). MOVIE is mandatory for DVD. There cannot
be an instance of DVD without a related instance of MOVIE.
35
a) Mandatory cardinalities
(min cardinality is one on both sides)
A PATIENT HISTORY
is recorded for one
and only one
PATIENT
An EMPLOYEE can be
assigned to any number of
PROJECTs, or may not be
assigned to any PROJECT
at all
37
c) Optional cardinalities
(min cardinality is zero on both sides)
A PERSON is
married to at
most one other
PERSON, or may
not be married
at all
38
39
ATTRIBUTE or ENTITY ?
Figure 2-15a Simple
Multivalued
Attributes versus
Relationships
Unary
relationship
Has
Prerequisites
COURSE
Course ID
Course Title
Is Prerequisite For
Minimum Grade
By creating a relationship,
we can also add some
attributes
41
Binary
relationship
EMPLOYEE
Employee ID
Employee Name
Possesse
s
SKILL
Skill Code
Skill Title
Skill Type
42
ASSOCIATIVE ENTITIES
43
44
Used In Assemblies
45
ITEM
Effective Data
Quantity
46
49
50
51
52
54
Data model
for Pine Valley
Furniture
Company
using the
textbook
notation
56
Figure 2-21
Data model for
Pine Valley
Furniture
Company using
Microsoft Visio
notation
Each many-tomany relationship
is converted into
two one-to-many
relationships
Different modeling
software tools may
have different
notation for the
same constructs
57