Entity Modeling Pratt & Adamski, Ch 6

advertisement
Entity Modeling
Pratt & Adamski, Ch 6
Design Methodology
Data Modeling
The Pratt and
Adamski approach
is not a standard
MIS view.
Data Modeling
CS
Start with reports and
forms
Identify attributes
Identify tables
Normalize
MIS Approach
Start with a narrative
description
Identify entities
Design table structure
Check for
normalization
MIS Data Modeling
Top-down approach
Begins with a model of the firm
Focuses on tables and relationships
Begins by modeling entities and adds
attributes later
Normalization used as a confirmation
rather than design tool
Life Cycle
Enterprise Design: major components
Entities and relationships in context
Conceptual Design: business needs
Tables and attributes independent of
DBMS
Physical Design: technology design
Entities, attributes, constraints, associative
tables, etc. as they will be built
Enterprise Design
Determine the entities and relationships
that interact with the proposed system.
Don’t model attributes, constraints or tables
necessary to implement relational
structures or sub-classes
Enterprise Model
Customer
SalesRep
Order
Product
Supplier
Conceptual Design
Determine the model of the system
independent of the DBMS that will be
used for physical implementation.
System entities, primary keys, attributes,
relationships, constraints. No associative
entities, foreign keys or sub-classes.
Conceptual Model
Customer
SalesRep
CustomerID (PK)
Name
Address
SalesRepID (PK)
Name
Address
Order
OrderNumber (PK)
Date
Product
ProductNum (PK)
Description
Price
Category
Relational and Physical
Design
Produce a detailed model of the ultimate
system.
Model a complete normalized system. Then
denormalize selectively to improve the
operational characteristics of the final
database.
Relational Model
Customer
SalesRep
CustomerID (PK)
SalesRepID (FK)
Name
Address
SalesRepID (PK)
Name
Address
Product
Order
OrderNumber (PK)
CustomerID (FK)
Date
Order-Product
ProdNum (PK/FK)
OrderNum (PK/FK)
ProductNum (PK)
Description
Price
Category
Entity Modeling
Represent each entity as a table
Determine the attributes for each entity
Determine the relationships among the
entities
Definition: Schema
Notation
TableName( {attributes} )
Primary keys are underlined or denoted “PK”
Alternate keys are denoted “AK”
Secondary keys are denoted “SK”
Foreign keys are denoted “FK”
Faculty(FacID, Name, Office, Dept (FK))
E-R Diagrams
(P&A notation)
Entities
Table Name
Primary Key (PK)
Attributes (FK, SK)
Attributes
E-R Diagrams
(P&A notation)
Relationships: 1 to many
1
m
Department
Employee
Department
Employee
E-R Diagrams
(P&A notation)
Relationships: many to many
m
n
Student
Class
Student
Class
Data Modeling
Download