Professional Documents
Culture Documents
Department Salesperson
Sell Goods
Inventory Customer
Cash Cashier
Sell Goods Transformation
• To SALE
• Header and Detail for multi-product firm
• To Sale Header
• To Sale Detail
• Now, rearrange RAL relationships
• Look for special relationships (i.e.
business rules)
Data model: ERD with Normalization
Entity Types
• A collection of business objects
• An Entity is a uniquely identifiable object of
the collection, a manifestation of the entity
type, downstream is a tuple (or row) in a
database table
• Uniquely Identifiable mechanism is the
Identifier (downstream it is the Primary
Key (PK)), which enforces Entity Integrity
• Have attributes
Attributes
• Information that describes the entity type
• Has a data type
• Is mandatory or optional
• Has a Domain
• Downstream are columns in Relational
tables
• Foreign keys are not attributes!
Relationships
• Business rule aspects:
– Cardinality: pairing
– Optionality: requiring (type of referential
integrity inferred)
• REA Types:
– From “Event” to RAL
– From “Event” to “Event”
– Among the RAL
Different Notations to Represent
Relationship Cardinalities
(1,1)
(1,*)
(0,1)
(0,*)
Entity Subtypes
• An entity subtype is a subdivision of the
entity type
• Each subtype must have one or more
special attribute of its own and/or
participate in one or more special
relationship of its own
• The special attributes and relationships
are not common to all entities of the entity
type
Partitioning
• A classifying attribute is the basis for partitioning,
e.g. EMPLOYEE - Name, Number, Type where
Type can be Full-Time or Part-Time
• Each subtype must be associated with a
permitted value of the classifying attribute
• Each subtype inherits properties ( attributes,
identifiers, relationships) of its parent entity type
Partitioning can be
• Fully enumerated
• Not fully enumerated
• There can be multiple partitionings
NAME
ADDRESS
Staff NUMBER Part Time
TYPE
JOB STATUS
Rules for Partitioning and Subtypes
• Each subtype belongs to exactly one partitioning
• Each partitioning must be associated with a
classifying attribute
• The subtype to which a given entity occurrence
belongs must be identifiable by a classifying
attribute value
• A fully enumerated partitioning must divide the
entity type into two or more subtypes
Refining the Data Model
• Developing a data model is iterative,
aiming at an accurate portrayal of the
business
• A set of techniques can be applied to
identify and reduce likely errors
• Each component of the data model is
subject to refinement
Identifiers (to be Primary Keys (PKs))
• Each identifier of an entity type consists of
one or more attributes and/or relationships
that uniquely identify an entity
• A single attribute may be an identifier, e.g.
STUDENT - Name, Address, Number
Composite Identifier Using an Attribute
and Relationship
Attributes
Order is included on
NUMBER
PRICE Item I Order
includes
QUANTITY
Product Warehouse
holds stores
is stored in
Stock
I o Item o I
is held for
Customer
delete - if relationship within circle
is mandatory, when customer is
deleted, whatever customer order is
related is also deleted
Order o o Product
specifies specified
by
Order Product