Detailed Data Modeling

advertisement

Detailed Data Modeling

Outline

• Data Modeling

• Modeling Constructs

– Entities

– Relationships

– Cardinality

• Model

• Basic Rules

• Advanced Rules

• Prototyping

• Process Modeling Homework

Data Modeling

• Why model data?

– Data needs are relatively constant over time, as is the nature of data needed in a particular enterprise

– Data is necessary for present and future decision making

– Strategies for collecting data into a system have changed radically

• 1850 all manual, face to face, post (mail)

• 1900 still manual, telephone

• 1950 early computer applications and storage

• 2000 little manual, web-interface, enterprise systems

– Data is static

Modeling Constructs

• Entity

• Relationship

• Attribute

– Primary Key

– Foreign Key

– Simple

– Composite

– Derivable

• Cardinality

– Broad business rules of min/max association

• Abstraction

– Grouping by type, generalization, class (IS-A), super and subtypes

Entity

• Types

– Persons - AGENT

– Places - Locations

– Objects - RESOURCES

– Events - EVENTS

– Concepts – Artifacts

• Instance

– Single occurrence of any specific Entity

Attribute

• Broad Characteristics Classification for each specific entity type

• Descriptive property

– Element, property, field

– Compound attributes

• Domain – restricted values – validation rules, look-up tables

• Identification

– Single value key

– Compound key

– Concatenated key

Relationship

• Natural organizational association

– Registered in; Purchase of; Sale of; Receipt of;

Payment for;

• Typically related to an event

– Assigned to a department; Declared major;

– Detail of natural organizational association

• Items purchased; Time worked; Repairs made;

Cardinality

• Minimum/maximum associations between entities

– Agent sells/buys many products

– Employee works on many projects

– Employee works in ONE department

• Mandatory

– At least one instance per each association must exist

• Parent (Mandatory dual relationship based on …)

• Optional

– An instance per association may not exist

• Marriage

• Different representations

– Crowsfoot, Chen, others

Types of Relationships

• Recursive

– Exists with same entity type

• Ex: Bill of Materials (inventory/products); Marriage (People)

• Non-Identifying

– Entity exists on its own

• Identifying

– Entity exists because of another entity (also called

‘Dependent’, ‘Attributive’

• One to Many

• Many to Many

Associative Entity

• Entity with a base in an association

• Inherits primary (Compound) key from more than one entity

– Purchase/Sales order detail (Order#, Item #)

– Shipping detail (Shipping Doc#, Item #)

– Time Card detail (esp. projects/jobs) (Time

Card#, Project/Job #)

• Second Normal Form

Generalization

• Also known as IS A relationship, CLASS

– Supertype

• Attributes used by other entity (subtype)

– People

– Subtype

• Inherits attributes from supertype

• Has additional set of attributes

– Student, Employee

• May or may not be multiple subtypes

– Student, Employee, Alumni (inclusive)

– Salaried, hourly (exclusive)

Conceptual Modeling Summary

• Entity Relationship Model

– Chen, 1976

• Entity

– Noun, Attributes

• Relationship

– Verb, Cardinality

– Natural business association

– Duality

• Set Theory

• Notation

– See Table 4-1; Figure 8-3 (Whitten, 316 /299)

• REA Model

• CASE Tool (Visible Analyst)

• Visio

Normalization

• Strategy used in evolving data model

• First Normal Form (1NF)

– Remove repeating groups – no more than one value for a single instance of that entity

• Second Normal Form (2NF)

– All non-key attributes dependent upon full primary key

(Compound Key) and in 1NF

• Third Normal Form (3NF)

– All non-key attributes not dependent on another non-key attribute and in 2NF

• REMEMBER – All values to be dependent upon the primary key, and ONLY the primary key

ERD and REA

• REA derived from ERD

• REA reflects duality of event, critical for enterprise modeling

• REA supplements ERD

– Add duality

• Accounts as artifacts

– Organizational rules

– Queries

ERD to Data Design (Access)

• Entities correspond to tables in RDBMS; Stores in

Data Flow Diagram

• Convert ERD to Relational Model (Design Phase),

Tables for Physical Design

• Access - Associate (in Relationship screen)

Primary Key Attribute (field) of ONE side to

Foreign Key Attribute (field) of MANY side

– Enforce Referential Integrity Rules, if desired

Homework Chapter 9

• Problems and Exercises

– 1

– 6

– 7

– 17

Download