Top Banner
The REA Model
32

The REA Model. The REA model provides structure for developing an accounting database It helps to identify It helps to The REA Model.

Dec 29, 2015

Download

Documents

Ophelia Rice
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: The REA Model. The REA model provides structure for developing an accounting database It helps to identify It helps to The REA Model.

The REA Model

Page 2: The REA Model. The REA model provides structure for developing an accounting database It helps to identify It helps to The REA Model.

The REA model provides structure for developing an accounting database

•It helps to identify

•It helps to

The REA Model

Page 3: 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

Page 4: The REA Model. The REA model provides structure for developing an accounting database It helps to identify It helps to The REA Model.

• Resources have economic value to the organization.

• What are some examples?

RESOURCES

• Agents are the people and organizations

• What are some examples?

AGENTS

Page 5: The REA Model. The REA model provides structure for developing an accounting database It helps to identify It helps to The REA Model.

• Events are the business activities

• What are some examples?

EVENTS

Page 6: The REA Model. The REA model provides structure for developing an accounting database It helps to identify It helps to The REA Model.

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

Page 7: The REA Model. The REA model provides structure for developing an accounting database It helps to identify It helps to The REA Model.

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

Page 8: The REA Model. The REA model provides structure for developing an accounting database It helps to identify It helps to The REA Model.

• 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

Page 9: The REA Model. The REA model provides structure for developing an accounting database It helps to identify It helps to The REA Model.

• The basic economic exchange in the revenue cycle

• Draw sales and cash receipts events entities as rectangles

• Relationship between them as a diamond.

Page 10: The REA Model. The REA model provides structure for developing an accounting database It helps to identify It helps to The REA Model.

• 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

Page 11: The REA Model. The REA model provides structure for developing an accounting database It helps to identify It helps to The REA Model.

• Identify the agents who participate in those events.

• There will always be at least one internal agent

• And in most cases, an external agent

Page 12: The REA Model. The REA model provides structure for developing an accounting database It helps to identify It helps to The REA Model.

• 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

Page 13: The REA Model. The REA model provides structure for developing an accounting database It helps to identify It helps to The REA Model.

Decomposing Sales into Orders and Sales

CustomerOrders

Sales

Customer

InventorySalesperso

n

Customer

Inventory-Orders

Inventory-Sales

Leads to

Participant

Participant

Participant

Participant

Page 14: The REA Model. The REA model provides structure for developing an accounting database It helps to identify It helps to The REA Model.

• Cardinalities indicate

• • Expressed as a pair of numbers.

• First number•

• Second number•

Step 4: Determining Cardinalities

Page 15: The REA Model. The REA model provides structure for developing an accounting database It helps to identify It helps to The REA Model.

• 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

Page 16: The REA Model. The REA model provides structure for developing an accounting database It helps to identify It helps to The REA Model.

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

Sales Customer(0, N)

Page 17: The REA Model. The REA model provides structure for developing an accounting database It helps to identify It helps to The REA Model.

• 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)

Page 18: The REA Model. The REA model provides structure for developing an accounting database It helps to identify It helps to The REA Model.

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

Page 19: The REA Model. The REA model provides structure for developing an accounting database It helps to identify It helps to The REA Model.

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

Sales Customer(0, N)

Page 20: The REA Model. The REA model provides structure for developing an accounting database It helps to identify It helps to The REA Model.

• 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.

Page 21: The REA Model. The REA model provides structure for developing an accounting database It helps to identify It helps to The REA Model.

• 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

Page 22: The REA Model. The REA model provides structure for developing an accounting database It helps to identify It helps to The REA Model.

SalesCash

Receipts

1 1

A one-to-one relationship

Page 23: The REA Model. The REA model provides structure for developing an accounting database It helps to identify It helps to The REA Model.

SalesCash

Receipts

N 1

A one-to-many relationship

Page 24: The REA Model. The REA model provides structure for developing an accounting database It helps to identify It helps to The REA Model.

A one-to-many relationshipExample 2

SalesCash

Receipts

1 N

Page 25: The REA Model. The REA model provides structure for developing an accounting database It helps to identify It helps to The REA Model.

A many-to-many relationship

SalesCash

Receipts

M N

Page 26: The REA Model. The REA model provides structure for developing an accounting database It helps to identify It helps to The REA Model.

• 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

Page 27: The REA Model. The REA model provides structure for developing an accounting database It helps to identify It helps to 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

Page 28: The REA Model. The REA model provides structure for developing an accounting database It helps to identify It helps to 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

Page 29: The REA Model. The REA model provides structure for developing an accounting database It helps to identify It helps to The REA Model.

• 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

Page 30: The REA Model. The REA model provides structure for developing an accounting database It helps to identify It helps to The REA Model.

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)

Page 31: The REA Model. The REA model provides structure for developing an accounting database It helps to identify It helps to The REA Model.

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

Create the Tables

Assign Attributes

• Primary keys:

• Other Attributes:

Page 32: The REA Model. The REA model provides structure for developing an accounting database It helps to identify It helps to The REA Model.

• 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