Professional Documents
Culture Documents
Carlos A. Suárez-Núñez
csuarez@usfq.edu.ec
Slides adaptados de: ISE 3024 – Virginia Tech - Prof. John P. Shewchuk
8. CONCEPTUAL DATA MODELING:
FUNDAMENTAL CONCEPTS
8 –1
Let’s first describe the fundamental concepts behind
conceptual data modeling.
8 –2
8.1 Entities, Entity Classes, Attributes and Attribute
Values
8 –3
Entity Class = collection of similar entities
8 –4
Attributes = characteristics used to define similar entities.
Shelf: shelfId
8 –5
Attribute Values = values for attributes for a particular entity.
book
Id title author publisher ISBN year price
12 Star Wars: Jedi Trial Dan Cragg Random House 0-3454-6115-0 2005 $6.99
27 Band of Brothers Stephen Ambrose Simon & Schuster 0-7432-2454-X 2001 $17.82
9 Circle of Friends Maeve Binchy Dell Publishing 0-4402-1126-3 1995 $7.99
37 Message In ABottle Nicholas Sparks Time Warner 1-5948-3636-1 1999 $7.50
23 The Long Road Home Danielle Steel Dell Publishing 0-4402-4344-0 2006 $14.99
4 Star Wars: Jedi Trial Dan Cragg Random House 0-3454-6115-0 2005 $6.99
18 Beyond Valor Patrick O’Donnell Simon & Schuster 0-6848-7385-0 2001 $8.99
32 Curious George Margret and H.A. Rey Houghton Mifflin 0-3951-5023-X 1973 $14.00
17 Beyond Valor Patrick O’Donnell Simon & Schuster 0-6848-7385-0 2001 $8.99
8 –6
Customer entities:
address
lastName firstName street city state zip
Smith John 214 Church St. Blacksburg VA 24073
Davis Diane 185 Clay St. Blacksburg VA 24073
O’Keefe Patrick 35 Cambria St. Christiansburg VA 24061
Smith John 24 Range Road Radford VA 24141
Morgan Leslie 240 Kent St., Apt. 27 Christiansburg VA 24061
Carter Brian 14 2nd Street Lafayette IN 47096
8 –7
Supplier entities: Shelf entities:
8 –8
8.2 Attributes
Attribute Type
• single-valued - e.g., title (attribute of Book)
• multivalued - e.g., phone (attribute of Supplier)
• composite - e.g., address
8 –9
Attribute Definition
i) name
vi)description
8 –10
e.g.,
Data
Name Type Length Format Domain Description Example
8 –11
Key Attributes
Key Attribute = attribute which, either on its own or along
with others, uniquely identifies entities
within a class.
Book:
Customer:
Supplier:
Shelf:
8 –12
Each such attribute (or set of attributes) = key.
• Primary key: preferred (only) key. Every entity class must
have a primary key.
• Secondary key: alternative key.Entity classes may have
one or more secondary keys.
Customer:
Supplier:
Shelf:
8 –14
For any non-key attribute:
8 –15
e.g.,
address
lastName firstName street city state zip
Smith John 214 Church St. Blacksburg VA 24073
Davis Diane
O’Keefe Patrick 35 Cambria St. VA 24061
Smith John 24 Range Road Radford VA 24141
8 –16
Derived Attributes
Derived attribute = attribute for which values are not
entered directly, but is calculated from
other data instead.
Book:
Customer:
Supplier:
Shelf
8 –17
8.3 Relationships and Relationship Types
8 –18
Relationship Type = specification of the nature of an
association that one entity may have
with another (entities of different
classes usually)
8 –19
Can also think of relationships as instances of a given
relationship type.
8 –20
Relationship types may have attributes (just like entity
classes).
8 –21
8.4 Constraints on Relationship Types
8 –22
One-to-Many (1:M) – an entity from the first class may be
related to multiple entries from the
second: an entity from the second
may be related to at most one entity
from the first.
8 –23
Many-to-Many (M:N) – an entity from either class may
be related to multiple entries
from the other class.
8 –24
Min/Max Constraints
8 –25
Each book, however, is found in exactly one shelf.
- max cardinality of Shelf = 1
- min cardinality of Shelf = 1
8 –26
Participation Constraints
8 –28
8.5 The Discovery Process
8 –29
Result = narrative descriptions of how process/system
works or what information must be extracted from it.
8 –31
Anna’s Books is a small bookstore which sells books to walk-in
customers. The owner wants computer support in:
8 –32
Customers purchase one or more books at a time: for each
purchase, the date must be recorded. The first and last name of
each customer is known: it is desirable to also know each
customer’s address (for advertising purposes). The title, author,
publisher, year, price, and ISBN # are recorded for each book.
Books are located on one of forty shelves. Each shelf can hold up
to sixty books. All books of the same type (i.e., title) are to be kept
together on the same shelf (one shelf is sufficient for any title).
8 –34
Attribute Type and/or
Entity Class Attribute Constraints
Supplier name Key
state
phone Multivalued attribute
rating Value from {A, B, C}
Shelf shelfId Key
8 –35
(b) Relationship types, cardinality ratio constraints, and attributes:
Relationship Type and Cardinality
Entity Classes Ratio Attributes
Customer Purchases Book 1:M saleDate
Book AvailableFrom Supplier M:N price
Shelf Holds Book 1:M
8 –36
(c) Participation constraints and min/max cardinality constraints:
8 –37
8.7 Example: Conceptual Data Modeling for JA
Industries
8 –38
JA Industries produces various machined components via
the use of manufacturing cells. The company aims to
improve productivity on the shop floor.
8 –39
Each cell at JA Industries has a unique cell number, is of a
specific type, and consists of 2-4 machines. Some cells also
contain a robot for loading/unloading machines, in which case
the single robot handles all machines in the cell. Every robot
has a particular number, and is of a specific type and model.
Shop workers perform load/unload if there is no robot in a cell.
8 –41
(a) Entity classes, attributes, and additional attribute information:
8 –42
Constraints or Further
Entity Class Attribute Description
Part partSN Key
Op
Process processId Key
process
Description
ProcessPlan planNo Key
partType
planners Multivalued attribute
date
Operation opno Key
setup
run
8 –43
(b) Relationship types, cardinality ratio constraints, and attributes:
8 –44
(c) Participation constraints and min/max cardinality constraints:
8 –45
Relationship Entity Participation Min/Max
Type Class Constraint Cardinality
DoneAt Process mandatory (1..5)
Machine mandatory (1..M)
DoneVia Process optional (1..1)
Operation mandatory (0..M)
Performs Machine optional (1..1)
Operation mandatory (0..M)
Has ProcessPlan mandatory (1..1)
Operation mandatory (1..4)
For ProcessPlan optional (1..1)
Part mandatory (0..M)
8 –46