Top Banner
Chapter 18 Implementing an REA Model in a Relational Database Copyright © 2012 Pearson Education, Inc. publishing as Prentice Hall 18-1
17
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: Chapter 18

Chapter 18

Implementing an REA Model in a Relational Database

Copyright © 2012 Pearson Education, Inc. publishing as Prentice Hall 18-1

Page 2: Chapter 18

Learning Objectives

Integrate separate REA diagrams for individual business cycles into a single, comprehensive organization-wide REA diagram.

Build a set of tables to implement an REA model of an AIS in a relational database.

Explain how to write queries to retrieve information from an AIS relational database built according to the REA data model.

Copyright © 2012 Pearson Education, Inc. publishing as Prentice Hall 18-2

Page 3: Chapter 18

REA Diagram—Revenue Cycle

18-3

Make Sale

Page 4: Chapter 18

REA Diagram—Expenditure Cycle

18-4

Page 5: Chapter 18

REA Diagram—Payroll Cycle

18-5

Get Time

Page 6: Chapter 18

REA Redundancies

Separate REA for an organization will have redundant entities Resource

Each resource entity must be connected to: The resource entity is linked to event entities

in one business cycle and to event entities in the other cycle One event that increases the resource and, One event that decreases the resource No effect on cardinality

Copyright © 2012 Pearson Education, Inc. publishing as Prentice Hall 18-6

Page 7: Chapter 18

REA Redundancies

Events and Agents Alters the minimum cardinalities

associated with the other events that are related to the merged events or agents May be linked to either an event or agent

that is part of one business cycle or to an event or agent that is part of another cycle but cannot be linked to both events or agents at the same time The minimum cardinality associated with the other

events and agents must be 0 in the integrated REA diagram

Copyright 2012 © Pearson Education, Inc. publishing as Prentice Hall 18-7

Page 8: Chapter 18

Make Sale

Get Time

Integrated REA Diagram

18-8

Revenue

Cycle

Page 9: Chapter 18

Cardinality Effect of Merging Resources

Copyright © 2012 Pearson Education, Inc. publishing as Prentice Hall 18-9

Cardinalities between resource and entities remain the same.

Make Sale

Page 10: Chapter 18

Cardinality Effect of Merging Events

Copyright © 2012 Pearson Education, Inc. publishing as Prentice Hall 18-10

The cardinality between Disburse Cash and Supplier and Employee (as payee) is now 0 to 1, that is, a disbursement can be made to the supplier or the employee but not both!

Page 11: Chapter 18

Cardinality Effect of Merging Events

Copyright 2012 Pearson Education, Inc. publishing as Prentice Hall 18-11

The cardinality between Disburse Cash and Supplier and Employee (as payee) is now 0 and 1, that is, a disbursement can be made to the supplier or the employee but not both!

The cardinality between Disburse Cash and Receive Inventory and Time Worked is now 0 and 1, that is, a disbursement can be made to the for Accounts Payable (Receive Inventory) or Payroll (Time Worked) but not both!

Get Get TimeTime

Disburse Disburse CashCash

Receive Receive InventoryInventory

SupplierSupplier

Employees Employees (Cashier)(Cashier)

Employees Employees (as Payee)(as Payee)

Employees Employees

Page 12: Chapter 18

Rules for Creating Integrated REA Diagram

1. Every event must be linked to at least one resource.

2. Every event must be linked to two agents who participate in that event.

3. Every event that involves the disposition of a resource must be linked to an event that involves the acquisition of a resource.

4. Every resource must be linked to at least one event that increments that resource and to at least one event that decrements that resource.

5. If event A can be linked to more than one other event or agent, but cannot be linked simultaneously to all of those other events or agents, then the REA diagram should show that event A is linked to a minimum of 0 of each of those other events or agents.

18-12

Page 13: Chapter 18

Using REA Diagram to Create Relational Database

Advantage: Ensures the elimination of anomalies:

Update Insert Delete

Copyright © 2012 Pearson Education, Inc. publishing as Prentice Hall 18-13

Page 14: Chapter 18

REA to Database Steps

1. Create a table for each distinct entity in the diagram and for each many-to-many relationship.

Copyright © 2012 Pearson Education, Inc. publishing as Prentice Hall 18-14

Page 15: Chapter 18

REA to Database Steps

2. Assign attributes to appropriate tables. Identify primary keys:

Attributes that uniquely identifies each record.

For M:N relationships the primary key consists of two attributes that represent the primary keys of each entity linked in that relationship.

Identify remaining attributes for table.

Copyright 2012 © Pearson Education, Inc. publishing as Prentice Hall 18-15

Page 16: Chapter 18

REA to Database Steps

3. Use foreign keys to implement one-to-one and one-to-many relationships.

1:1 Relationships Choice of which table to place foreign key is

arbitrary, Often if events are sequential, the foreign key is

placed in the later event of the sequence, 1:M Relationships

Primary key of entity that can be linked to multiple instances of the other will become the foreign key in the other table.

Copyright 2012 © Pearson Education, Inc. publishing as Prentice Hall 18-16

Page 17: Chapter 18

Retrieving Information from REA Database

Journals Information contained in event tables

Ledgers Information contained in resource tables

Financial statements Information contained in resources and Information on imbalances

Accounts receivable Sales transactions for which customer payments have

not yet been received Accounts payable

Purchases from suppliers that have not yet been paid

Copyright © 2012 Pearson Education, Inc. publishing as Prentice Hall 18-17