ERD
ERD
Data Modeling
PC 113
Software Engineering
Part # 2
2 Study Objectives
Entity:
"...anything (people, places, objects, events,
etc.) about which we store information (e.g.
supplier, machine tool, employee, utility pole,
airline seat, etc.).”
Tangible: customer, product
Intangible: order, accounting receivable
Look for singular nouns (beginner)
BUT a proper noun is not a good candidate….
Part # 2
10
Entity
Instance
Entity instance: a single occurrence of an entity.
6 instances
Attribute:
Attributes are data objects that either identify
or describe entities (property of an entity).
In other words, it is a descriptor whose values
are associated with individual entities of a
specific entity type
The process for identifying attributes is similar
except now you want to look for and extract those
names that appear to be descriptive noun phrases.
Part # 2
12 How to find relationships?
Relationship:
Relationships are associations between
entities.
Typically, a relationship is indicated by a verb
connecting two or more entities.
Employees are assigned to projects
Relationships should be classified in terms of
cardinality.
One-to-one, one-to-many, etc.
Part # 2
13 How to find cardinalities?
Cardinality:
The cardinality is the number of occurrences
in one entity which are associated to the
number of occurrences in another.
There are three basic cardinalities (degrees of
relationship).
one-to-one (1:1), one-to-many (1:M), and
many-to-many (M:N)
Part # 2
14
Identifier
“attributes that uniquely identify entity
instances”
Becomes a PK in RDS
Composite identifiers are identifiers that
consist of two or more attributes
Identifiers are represented by underlying
the name of the attribute(s)
Employee (Employee_ID), student (Student_ID)
Part # 2
15 Crow’s Foot Notation
1-to-M relationship
M-to-N relationship
Part # 2
Cardinality con’t
Part # 2
19 Example Model
Data Model by Peter Chen’ Notation
Part # 2
(first - original)
Part # 2
21 Business Rule Example 1
Attributes
“Describe detail information about an entity ”
Entity: Employee
Attributes:
Employee-Name
Address (composite)
Phone Extension
Date-Of-Hire
Job-Skill-Code
Salary
Part # 2
27
Classes of attributes
Simple attribute
Composite attribute
Derived attributes
Single-valued attribute
Multi-valued attribute
Part # 2
28
Simple/Composite attribute
A simple attribute cannot be subdivided.
Examples: Age, Gender, and Marital status
A composite attribute can be further
subdivided to yield additional attributes.
Examples:
ADDRESS -- Street, City, State, Zip
PHONE NUMBER -- Area code, Exchange
number
Part # 2
29
Derived attribute
is not physically stored within the database
instead, it is derived by using an algorithm.
Example 1: Late Charge of 2%
MS Access: InvoiceAmt * 0.02
Example 2: AGE can be derived from the date of
birth and the current date.
MS Access: int(Date() – Emp_Dob)/365)
Part # 2
30
Single-valued attribute
can have only a single (atomic) value.
Examples:
A person can have only one social security number.
A manufactured part can have only one serial number.
A single-valued attribute is not necessarily
a simple attribute.
Part No: CA-08-02-189935
Location: CA, Factory#:08, shift#: 02, part#: 189935
Part # 2
31
Multi-valued attributes
can have many values.
Examples:
A person may have several college degrees.
A household may have several phones with different numbers
A car color
Part # 2
32 Example - “Movie
Database”
Entity:
Movie Star
Attributes:
SS#: “123-45-6789” (single-valued)
Cell Phone: “(661)123-4567, (661)234-
5678” (multi-valued)
Name: “Harrison Ford” (composite)
Address: “123 Main Str., LA, CA” (composite)
Gender: “Female” (simple)
Age: 24 (derived)
Part # 2
33 Procedure of ERD