the rea model. the rea model provides structure for developing an accounting database it helps to...

32
The REA Model

Upload: ophelia-rice

Post on 29-Dec-2015

218 views

Category:

Documents


2 download

TRANSCRIPT

The REA Model

The REA model provides structure for developing an accounting database

•It helps to identify

•It helps to

The REA Model

What is an entity?

Three distinct types:1 RESOURCES

2 EVENTS

3 AGENTS

Types of Entities

• Resources have economic value to the organization.

• What are some examples?

RESOURCES

• Agents are the people and organizations

• What are some examples?

AGENTS

• Events are the business activities

• What are some examples?

EVENTS

Four steps:

1. Identify the pair of events

2. Identify the resources affected by each event and the agents

3. Analyze each economic exchange event to determine whether it should be decomposed

4. Determine the cardinalities of each relationship.

Developing an REA Diagram

Basic REA Diagram

Resource A GET Resource AInflo

wParticipa

nt Internal Agent

Resource B GIVE Resource BOutflow

Participant Internal Agent

Economic

Duality

External Agent

External Agent

Participant

Participant

• Useful to divide the paper into three columns

• Left column should be used for resources.

• Middle column should be used for events.

• Right column should be used for agents.

Step 1: Identify Economic Exchange Events

• The basic economic exchange in the revenue cycle

• Draw sales and cash receipts events entities as rectangles

• Relationship between them as a diamond.

• The sales event involves the disposal of the resource

• The cash receipts event involves the acquisition of the resource

Step 2: Identify Resources and Agents

• Identify the agents who participate in those events.

• There will always be at least one internal agent

• And in most cases, an external agent

• Can each economic exchange event be decomposed into a combination of one or more commitment exchange events.

• • Example:

• The sales event may be decomposed into the “take order”

• And “deliver order”

Step 3: Include Commitment Events

Decomposing Sales into Orders and Sales

CustomerOrders

Sales

Customer

InventorySalesperso

n

Customer

Inventory-Orders

Inventory-Sales

Leads to

Participant

Participant

Participant

Participant

• Cardinalities indicate

• • Expressed as a pair of numbers.

• First number•

• Second number•

Step 4: Determining Cardinalities

• The minimum cardinality of a relationship

• Minimum cardinalities can be either 0 or 1.• A minimum cardinality of zero

• A minimum cardinality of 1

Minimum Cardinality

• The minimum cardinality of zero in the (0, N) cardinality pair

Sales Customer(0, N)

• The minimum cardinality of 1 in the (1, 1) cardinality pair• The minimum cardinality of 1 in the (1, 1) cardinality pair

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

The maximum cardinality of a relationship

Maximum cardinalities can be either 1 or N.

A minimum cardinality of 1

A maximum cardinality of N

Maximum Cardinality

• The maximum cardinality of N in the (0, N) cardinality pair

Sales Customer(0, N)

• The maximum cardinality of 1 in the (1, 1) cardinality pair

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

• Cardinalities are not arbitrarily chosen by the database designer.

• Three basic types of relationships

1. A one-to-one relationship (1:1)

2. A one-to-many relationship (1:N)

3. A many-to-many relationship (M:N)

Relationships between Entities

SalesCash

Receipts

1 1

A one-to-one relationship

SalesCash

Receipts

N 1

A one-to-many relationship

A one-to-many relationshipExample 2

SalesCash

Receipts

1 N

A many-to-many relationship

SalesCash

Receipts

M N

• An Entity-Relationship (E-R) diagram is a common method for portraying a database schema.

• An E-R diagram shows

• Entities are represented by

• Relationships between entities

ER Diagrams using the REA Model

Inventory

Cashier

Vendor

Cash Disbursem

entCash

Buyer(Purchasing

Agent)

Purchases

P/D

Stockflow Participant

Participant

Participant

Participant

Inventory-Purchases

(0,N)

(0,N)

(1,N)(0,N)

(0,N)

(0,N)

(0,N)

(1,1)

(1,1)

(1,1)

(1,1)

(1,1)

(1,N)

(0,N)

Sample ERD using the REA Model

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

• Create the schema from the REA diagram.

• What is a well designed relational database?

Implementing the REA Diagram

• Implementing an REA diagram in a relational database is a three-step process:

• Create a table

• Assign attributes to appropriate tables• Use foreign keys to implement

Implementing the REA Diagram, continued

The REA Model

Inventory

Cashier

Vendor

Cash Disbursem

entCash

Buyer(Purchasing

Agent)

Purchases

P/D

Stockflow Participant

Participant

Participant

Participant

Inventory-Purchases

(0,N)

(0,N)

(1,N)(0,N)

(0,N)

(0,N)

(0,N)

(1,1)

(1,1)

(1,1)

(1,1)

(1,1)

(1,N)

(0,N)

• From the previously discussed REA diagram, nine tables would be created

Create the Tables

Assign Attributes

• Primary keys:

• Other Attributes:

• FOREIGN KEYS

• One-to-One Relationships:

• One-to-Many Relationships:

• The primary key of the entity with the maximum cardinality of N becomes a foreign key in the entity with a maximum cardinality of 1

Implement the 1:1 and 1:M Relationships