data modeling and database design

64
Acct 316 Acct 316 Acct 316 Acct 316 Acct 316 Acct 316 A c c t 3 1 6 A c c t 3 1 6 A c c t 3 1 6 Data Modeling and Database Design 5 UAA – ACCT 316 Accounting Information Systems Dr. Fred Barbee C h a p t e r

Upload: gram

Post on 12-Feb-2016

68 views

Category:

Documents


0 download

DESCRIPTION

Data Modeling and Database Design. 5. Chapter. UAA – ACCT 316 Accounting Information Systems Dr. Fred Barbee. Hmmm? What is data modeling?. ACCT 316 ACCT 316 ACCT 316. What is Data Modeling?. The Blind Men and the Elephant. ACCT 316 ACCT 316 ACCT 316. - PowerPoint PPT Presentation

TRANSCRIPT

Page 1: Data Modeling and Database Design

Acct 316 Acct 316 Acct 316 Acct 316 Acct 316 Acct 316

Acct 316 Acct 316 Acct 316

Data Modeling and Database Design5

UAA – ACCT 316Accounting Information

SystemsDr. Fred Barbee

Chapter

Page 2: Data Modeling and Database Design

Acct 316 Acct 316 Acct 316 Acct 316 Acct 316 Acct 316

Acct 316 Acct 316 Acct 316

Hmmm? What is

data modeling?

Page 3: Data Modeling and Database Design

What is Data Modeling?

ACCT 316 ACCT 316 ACCT 316

The Blind Men and the Elephant

Page 4: Data Modeling and Database Design

What is Data Modeling?

ACCT 316 ACCT 316 ACCT 316

So what! You Say!

Page 5: Data Modeling and Database Design

What is Data Modeling?

ACCT 316 ACCT 316 ACCT 316

Without a model of what we are building, we are like these blind men: we may be partly right, but we are probably mostly wrong.

Page 6: Data Modeling and Database Design

What is Data Modeling?

ACCT 316 ACCT 316 ACCT 316

The elephant – a third grader’s view.

Page 7: Data Modeling and Database Design

What is Data Modeling?

ACCT 316 ACCT 316 ACCT 316

You cannot understand (and thus represent) something unless you comprehend it completely – enterprise-wide.

Page 8: Data Modeling and Database Design

What is Data Modeling?

ACCT 316 ACCT 316 ACCT 316

Plato’s “Myth of the Cave”

Page 9: Data Modeling and Database Design

Acct 316 Acct 316 Acct 316 Acct 316 Acct 316 Acct 316

Acct 316 Acct 316 Acct 316

Hmmm? What is

data modeling?

Page 10: Data Modeling and Database Design

Acct 316 Acct 316 Acct 316

The Text Definition . . .

Data modeling is the process of defining a database

so that it faithfully represents all aspects of the organization, including its interactions with the external environment.

Page 11: Data Modeling and Database Design

Acct 316 Acct 316 Acct 316

Other Definitions . . .

Data modeling is the task of formalizing the data requirements of the business process as a conceptual model.

Hall, James A. Accounting Information Systems

Southwestern Publishing, 2001

Page 12: Data Modeling and Database Design

Acct 316 Acct 316 Acct 316

Other Definitions . . .

Data modeling is the process of defining what data you want to capture in your database and the relationships between data.

Database Services University of Michigan http://www.umich.edu/~dbsvcs/services/modeling.html

Page 13: Data Modeling and Database Design

Acct 316 Acct 316 Acct 316 Acct 316 Acct 316 Acct 316

Acct 316 Acct 316 Acct 316

Data Modeling and Database Design5

Database Design Process

Chapter

Page 14: Data Modeling and Database Design

Planning

Requirements Analysis

Design

Coding

Implementation

Operation andMaintenance

Data Modeling Occurs Here

Figure 5-1

Page 15: Data Modeling and Database Design

Let’s

At each of these steps individually.

The Database Design Process

ACCT 316 ACCT 316 ACCT 316

Page 16: Data Modeling and Database Design

Planning

Requirements Analysis

Design

Coding

Implementation

Operation andMaintenance

Initial planning to

determine the need for and feasibility of developing a new system.

Page 17: Data Modeling and Database Design

Planning

Requirements Analysis

Design

Coding

Implementation

Operation andMaintenance

Identifying User Needs

Page 18: Data Modeling and Database Design

Planning

Requirements Analysis

Design

Coding

Implementation

Operation andMaintenance

Developing the

contextual-external- and internal-level

schemas

Page 19: Data Modeling and Database Design

Planning

Requirements Analysis

Design

Coding

Implementation

Operation andMaintenance

Translating the internal-level

schema into the actual database structures that

will be implemented in the new system.

Page 20: Data Modeling and Database Design

Planning

Requirements Analysis

Design

Coding

Implementation

Operation andMaintenance

Transferring all data from the

existing system to the new database.

Page 21: Data Modeling and Database Design

Planning

Requirements Analysis

Design

Coding

Implementation

Operation andMaintenance

Using and maintaining

the new system.

Page 22: Data Modeling and Database Design

Acct 316 Acct 316 Acct 316 Acct 316 Acct 316 Acct 316

Acct 316 Acct 316 Acct 316

The Entity-Relationship (E-R) Diagram

Page 23: Data Modeling and Database Design

The Entity-Relationship (E-R) Diagram

ACCT 316 ACCT 316 ACCT 316

Entity Relations

hip

Page 24: Data Modeling and Database Design

Acct 316 Acct 316 Acct 316 Acct 316 Acct 316 Acct 316

Acct 316 Acct 316 Acct 316

The REA Data Model

Page 25: Data Modeling and Database Design

Acct 316 Acct 316 Acct 316

The REA Data Model

The REA data model is a conceptual modeling tool specifically designed to provide structure for designing AIS data bases.

Page 26: Data Modeling and Database Design

Acct 316 Acct 316 Acct 316

The REA Data Model

The REA data model provides structure in two ways:

By identifying what entities should be included in the AIS databaseBy prescribing how to structure relationships among the entities in the AIS database

Page 27: Data Modeling and Database Design

The REA Data Model

ACCT 316 ACCT 316 ACCT 316

Resources

Events Agents

Give-To- Get Duality

Page 28: Data Modeling and Database Design

The REA Data Model

ACCT 316 ACCT 316 ACCT 316

Resources

Events Agents

Resources: Those

things that have

economic value to the

firm.

Page 29: Data Modeling and Database Design

The REA Data Model

ACCT 316 ACCT 316 ACCT 316

Resources

Events Agents

Events: Various

Business Activities

Page 30: Data Modeling and Database Design

The REA Data Model

ACCT 316 ACCT 316 ACCT 316

Resources

Events Agents

Agents: People and Organizatio

ns that participate

in events.

Page 31: Data Modeling and Database Design

Acct 316 Acct 316 Acct 316 Acct 316 Acct 316 Acct 316

Acct 316 Acct 316 Acct 316

Developing an REA Diagram

Page 32: Data Modeling and Database Design
Page 33: Data Modeling and Database Design

Acct 316 Acct 316 Acct 316 1Step 1: Identify the Economic Exchange Events

Identify the pair of events that reflect the basic economic exchange (give-to-get duality relationship) in that cycle.

Page 34: Data Modeling and Database Design

Identify the PAIR of events•One GET•One GIVE

Page 35: Data Modeling and Database Design

Acct 316 Acct 316 Acct 316 2Step 2: Identify Resources and Agents

Identify the Resources affected by each event and the agents who participate in those events.

Page 36: Data Modeling and Database Design

Identify . . .•RESOURCES affected by each event.•AGENTS who participate in the events.

Page 37: Data Modeling and Database Design

Acct 316 Acct 316 Acct 316 3Step 3: Include commitment Events

Analyze each economic exchange event to determine whether it should be decomposed into a combination of one or more commitment events and an economic exchange event.

Page 38: Data Modeling and Database Design

Include commitment events.

Page 39: Data Modeling and Database Design

Acct 316 Acct 316 Acct 316 4Determine the cardinalities of each relationship.

Step 4: Determine Cardinalities of Relationships

Page 40: Data Modeling and Database Design

Determine cardinalities of relationships.

Page 41: Data Modeling and Database Design

Sales Customer

How many sales transactions can be linked to each individual customer?

How many customers can be linked to each individual sales transaction?

Page 42: Data Modeling and Database Design

Cardinalities

ACCT 316 ACCT 316 ACCT 316

(1,N)Minimu

m

Maximum

Page 43: Data Modeling and Database Design

The first number is the minimum cardinality. It

indicates whether a row in this table must be linked to at

least one row in the table on the opposite side of that

relationship.

Page 44: Data Modeling and Database Design

Acct 316 Acct 316 Acct 316

Minimum Cardinality

The minimum cardinality of a relationship indicates whether each row in that entity MUST be linked to a row in the entity on the other side of the relationship.Minimum cardinalities can be either 0 or 1.

Page 45: Data Modeling and Database Design

Acct 316 Acct 316 Acct 316

Minimum Cardinalities

A minimum cardinality of zero means that a new row can be added to that table without being linked to any rows in the other table.A minimum cardinality of one means that each row in that table MUST be linked to at least one row in the other table

Page 46: Data Modeling and Database Design

Cardinalities

ACCT 316 ACCT 316 ACCT 316

Sales Made to Customer(0, N)

– The minimum cardinality of zero in the (0, N) cardinality pair to the left of the customer entity in the customer-sales relationship . . .

– . . . indicates that a new customer may be added to the database without being linked to any sales events.

Page 47: Data Modeling and Database Design

Cardinalities

ACCT 316 ACCT 316 ACCT 316

– The minimum cardinality of 1 in the (1,1) cardinality pair to the right of the sales entity in the customer-sales relationship . . .

– . . . indicates that a new sales transaction CAN ONLY be added if it is linked to a customer.

Sales Made to Customer(0, N)(1,1)

Page 48: Data Modeling and Database Design

The second number is the maximum cardinality. It

indicates whether one row in that table can be linked to more than one row in the

other table.

Page 49: Data Modeling and Database Design

Acct 316 Acct 316 Acct 316

Maximum Cardinalities

The maximum cardinality of a relationship indicates whether each row in that entity CAN be linked to more than one row in the entity on the other side of the relationship.

Maximum cardinalities can be either 1 or N.

Page 50: Data Modeling and Database Design

Acct 316 Acct 316 Acct 316

Maximum Cardinalities

A maximum cardinality of 1 means that each row in that table can be linked to at most only 1 row in the other table.A maximum cardinality of N means that each row in that table MAY be linked to more than one row in the other table.

Page 51: Data Modeling and Database Design

Cardinalities

ACCT 316 ACCT 316 ACCT 316

Sales Made to Customer(0, N)

– The maximum cardinality of N in the (0,N) cardinality pair to the left of the customer entity in the customer-sales relationship . . .

– . . . indicates that a given customer MAY be linked to many sales events.

Page 52: Data Modeling and Database Design

Cardinalities

ACCT 316 ACCT 316 ACCT 316

– The maximum cardinality of 1 in the (1,1) cardinality pair to the right of the sales entity in the customer-sales relationship . . .

– . . . indicates that a given sales transaction can only be linked to one customer.

Sales Made to Customer(0, N)(1,1)

Page 53: Data Modeling and Database Design

Acct 316 Acct 316 Acct 316

Determine Cardinalities

Cardinalities are not arbitrarily chosen by the database designer.They reflect facts about the organization being modeled and its business practices obtained during the requirements analysis stage of the database design process.

Page 54: Data Modeling and Database Design

Acct 316 Acct 316 Acct 316

Cardinalities: Types of Relationships

Three basic types - depending on the maximum cardinality associated with each entity.

A one-to-one relationship (1:1)A one-to-many relationship (1:N)A many-to-many relationship (M:N)

Page 55: Data Modeling and Database Design

Types of Relationships

ACCT 316 ACCT 316 ACCT 316

Panel A: One-to-One (1:1) Relationship

Sales Cash Receipts

(0,1) (1,1)

Page 56: Data Modeling and Database Design

Types of Relationships

ACCT 316 ACCT 316 ACCT 316

Panel B: One-to-Many (1:N) Relationship

Sales Cash Receipts

(0,N)

(1,1)

Page 57: Data Modeling and Database Design

Types of Relationships

ACCT 316 ACCT 316 ACCT 316

Panel C: One-to-Many (1:N) Relationship

Sales Cash Receipts

(0,1) (1,N)

Page 58: Data Modeling and Database Design

Types of Relationships

ACCT 316 ACCT 316 ACCT 316

Panel D: Many-to-Many (M:N) Relationship

Sales Cash Receipts

(0,N)

(1,N)

Page 59: Data Modeling and Database Design

Acct 316 Acct 316 Acct 316 Acct 316 Acct 316 Acct 316

Acct 316 Acct 316 Acct 316

Build a Set of Tables to Implement an REA Model of an AIS in a Relational Database

Page 60: Data Modeling and Database Design

Acct 316 Acct 316 Acct 316

Implementing an REA Diagram in a Relational Database

An REA diagram can be used to design a well-structured relational database.

A well-structured relational database is one that is not subject to update, insert, and delete anomaly problems.

Page 61: Data Modeling and Database Design

Acct 316 Acct 316 Acct 316

Three Step Process

Create a table for each distinct entity and for each many-to many relationshipAssign attributes to appropriate tablesUse foreign keys to implement one-to-one and one-to-many relationships

Page 62: Data Modeling and Database Design

Implementing an REA Diagram

ACCT 316 ACCT 316 ACCT 316

Page 63: Data Modeling and Database Design

Implementing an REA Diagram

ACCT 316 ACCT 316 ACCT 316

Page 64: Data Modeling and Database Design

Implementing an REA Diagram

ACCT 316 ACCT 316 ACCT 316