Implementing an REA Model in a Relational Database

Slides:



Advertisements
Similar presentations
Database Design Using the REA Data Model
Advertisements

Business Processes, Data Modeling and Information Systems
BUSINESS DRIVEN TECHNOLOGY Plug-In T4 Designing Database Applications.
Chapter 3 Data Modeling Copyright © 2014 McGraw-Hill Education. All rights reserved. No reproduction or distribution without the prior written consent.
Copyright © 2015 Pearson Education, Inc. Database Design Chapters 17 and
Accounting System Design
Implementing an REA Model in a Relational Database
©2003 Prentice Hall Business Publishing, Accounting Information Systems, 9/e, Romney/Steinbart 5-1 Accounting Information Systems 9 th Edition Marshall.
FIS 431/631 Financial Information Systems: Analysis and Design REA Modeling Joe Callaghan Oakland University Department of Accounting & Finance.
© 2008 Prentice Hall Business Publishing Accounting Information Systems, 11/e Romney/Steinbart1 of 121 C HAPTER 16 Implementing an REA Model in a Relational.
Technology Review-II Professor Martin Professor Xiong CSUS
Database Design Using the REA Data Model
Entity-Relationship Model and Diagrams (continued)
Methodology Logical Database Design for the Relational Model
1 © Prentice Hall, 2002 Chapter 5: Logical Database Design and the Relational Model Modern Database Management 6 th Edition Jeffrey A. Hoffer, Mary B.
Accounting Databases Chapter 2 The Crossroads of Accounting & IT
Database Design Chapter 2. Goal of all Information Systems  To add value –Reduce costs –Increase sales or revenue –Provide a competitive advantage.
Chapter 3: Data Modeling
Implementing an REA Model in a Relational Database
Copyright © 2012 Pearson Education, Inc. publishing as Prentice Hall 18-1.
Database Design Using the REA Data Model
Hall, Accounting Information Systems, 7e ©2011 Cengage Learning. All Rights Reserved. May not be scanned, copied or duplicated, or posted to a publicly.
© 2008 Prentice Hall Business Publishing Accounting Information Systems, 11/e Romney/Steinbart1 of 138 C HAPTER 15 Database Design Using the REA Data Model.
Database Relationships Objective 5.01 Understand database tables used in business.
Chapter 5 UNDERSTANDING AND DESIGNING ACCOUNTING DATA.
Database Design Using the REA Data Model
DAY 15: ACCESS CHAPTER 2 Larry Reaves October 7,
McGraw-Hill/Irwin Copyright © 2005 by The McGraw-Hill Companies, Inc. All rights reserved. ENTERPRISE INFORMATION SYSTEMS A PATTERN BASED APPROACH Chapter.
© 2008 Prentice Hall Business Publishing Accounting Information Systems, 11/e Romney/Steinbart1 of 138 C HAPTER 15 Database Design Using the REA Data Model.
1 ER Modeling BUAD/American University Entity Relationship (ER) Modeling.
The REA Model. The REA model provides structure for developing an accounting database It helps to identify It helps to The REA Model.
Accounting Information Systems 9th Edition
Concepts and Terminology Introduction to Database.
MIS 301 Information Systems in Organizations Dave Salisbury ( )
MIS 301 Information Systems in Organizations Dave Salisbury ( )
© 2006 Prentice Hall Business Publishing Accounting Information Systems, 10/e Romney/Steinbart1 of 131 C HAPTER 16 Implementing an REA Model In a Relational.
© 2006 Prentice Hall Business Publishing Accounting Information Systems, 10/e Romney/Steinbart1 of 96 C HAPTER 17 Special Topics in REA Modeling for the.
MS Access: Creating Relational Databases Instructor: Vicki Weidler Assistant: Joaquin Obieta.
Data Models and Relational Databases Chapter 2. Learning Objectives Identify primary and foreign keys for each entity and relevant relationships in the.
Acct 316 Acct 316 Acct 316 Data Modeling and Database Design 5 UAA – ACCT 316 Accounting Information Systems Dr. Fred Barbee Chapter.
1 n 1 n 1 1 n n Schema for part of a business application relational database.
1 Relational Databases and SQL. Learning Objectives Understand techniques to model complex accounting phenomena in an E-R diagram Develop E-R diagrams.
Implementing an REA Model in a Relational Database
3 & 4 1 Chapters 3 and 4 Drawing ERDs October 16, 2006 Week 3.
1 © Prentice Hall, 2002 Chapter 5: Logical Database Design and the Relational Model Modern Database Management 6 th Edition Jeffrey A. Hoffer, Mary B.
Jozef Kuper.  Describe a Database  Entities  Atributes  Relationships.
Relational Database. I. Relational Database 1. Introduction 2. Database Models 3. Relational Database 4. Entity-Relationship Models 5. RDB Design Principles.
© 2006 Prentice Hall Business Publishing Accounting Information Systems, 10/e Romney/Steinbart1 of 138 C HAPTER 15 Database Design Using the REA Data Model.
MIS 301 Information Systems in Organizations Dave Salisbury ( )
1. Convert a conceptual business process level REA model into a logical relational model 2. Convert a logical relational model into a physical implementation.
1 ER Modeling BUAD/American University Mapping ER modeling to Relationships.
1 © Prentice Hall, 2002 ITD1312 Database Principles Chapter 4B: Logical Design for Relational Systems -- Transforming ER Diagrams into Relations Modern.
Logical Database Design and the Relational Model.
Copyright © 2012 Pearson Education, Inc. publishing as Prentice Hall 18-1.
© 2006 Prentice Hall Business Publishing Accounting Information Systems, 10/e Romney/Steinbart1 of 131 C HAPTER 16 Implementing an REA Model In a Relational.
Microsoft Access CS 110 Fall Entity Relationship Model Entities Entities Principal data object about which information is to be collectedPrincipal.
IT 5433 LM3 Relational Data Model. Learning Objectives: List the 5 properties of relations List the properties of a candidate key, primary key and foreign.
Database Design Chapters 17 and 18.
Chapter 5 UNDERSTANDING AND DESIGNING ACCOUNTING DATA
Implementing an REA Model in a Relational Database
View Integration and Implementation Compromises
Chapter 6 Relational Database Design: Converting Conceptual Models to Relational Databases.
Implementing an REA Model in a Relational Database
Implementing an REA Model in a Relational Database
Accounting Information Systems 9th Edition
Database Design Using the REA Data Model
Accounting System Design
Database Design Chapters 17 and 18.
Accounting System Design
Database Design Chapter 7.
Presentation transcript:

Implementing an REA Model in a Relational Database Chapter 18 Implementing an REA Model in a Relational Database

Intergraded REA Diagram

Rules for Creating Integrated REA Diagram Every event must be linked to at least one resource. Every event must be linked to two agents who participate in that event. Every event that involves the disposition of a resource must be linked to an event that involves the acquisition of a resource. Every resource must be linked to at least one event that increments that resource and to at least one event that decrements that resource. If event A can be linked to more than one other event, but cannot be linked simultaneously to all of those other events, then the REA diagram should show that event A is linked to a minimum of 0 of each of those other events.

Using REA Diagram to Create Relational Database Advantage: Creating a set of tables from an REA diagram automatically results in a well- structured relational database Ensures the elimination of anomalies: Update Insert Delete

REA to Database Steps Create a table for each distinct entity in the diagram and for each many-to-many relationship. 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. Use foreign keys to implement one-to-one and one-to-many relationships. An attribute of one entity that is itself the primary key of another entity.

Our integrated diagram has seven event entities. 5 1 6 2 3 7 4 Our integrated diagram has seven event entities.

Our integrated diagram has two resource entities. 1 2 Our integrated diagram has two resource entities.

2 1 3 3 1 2 3 3 There are three distinct agent entities. The first is the customer. The second agent entity is the supplier. The third agent entity is the employee. We label the types of employees to make the diagram more understandable, but they all go in one table. 3 3

IMPLEMENTING AN REA DIAGRAM IN A RELATIONAL DATABASE Total distinct entities to be represented in separate tables: 7

IMPLEMENTING AN REA DIAGRAM IN A RELATIONAL DATABASE Create a separate table to represent each many-to-many relationship in the conceptual model, I.e., for the following participation cardinality patterns (0,N)-(0,N) (0,N)-(1,N) (1,N)-(0,N) (1,N)-(1,N) You must create a separate table to represent the relationship The primary keys of the related entity tables are posted into the relationship table to form its primary key. This kind of primary key is called a composite or concatenated primary key There are no exceptions to this rule!!! If you post a foreign key in either direction, redundancy will be a problem for many-to-many relationships

Example: Many-Many Relationships(from DCH) Student# Name Address 1 Tony Cleveland 2 Emily New York 3 Leigh Birmingham Course# * Acg4401, Acg3101 Course# Name Acg4401 AIS Acg3101 FAR 1 Student#* 1, 2, 3 Note: Each record field must be single valued(no repeating groups)

Example: Many-Many Relationship (from DCH) Student# Name Address 1 Tony Cleveland 2 Emily New York 3 Leigh Birmingham Student# Course# 1 Acg4401 Acg3101 2 3 Course# Name Acg4401 AIS Acg3101 FAR 1 Student-Course Relationship Table

the many-to-many relationships. 3 1 2 4 5 the many-to-many relationships.

IMPLEMENTING AN REA DIAGRAM IN A RELATIONAL DATABASE Total number of tables in database: Table Types # Events 7 Resources 2 Agents 3 Distinct Entities 12 Many to many Tables 5 Total Tables 17

IMPLEMENTING AN REA DIAGRAM IN A RELATIONAL DATABASE Identify primary keys Every table in a relational database must have a primary key. The primary key is an attribute or combination of attributes that uniquely identifies each row in a table. It is typically a numeric identifier. The primary key is usually a single attribute. However for M:N relationship tables, it consists of two attributes that represent the primary key of each linked entity. These multiple-attribute primary keys are called concatenated keys.

Attribute assignment

Tables for Fred’s Train Shop Revenue cycle

Use foreign keys to implement one-to- one and one-to-many relationships. Minimum cardinalities may suggest which choice is more efficient. When there are two sequential events, the primary key of the event that occurs first is usually the foreign key in the event that occurs second. The primary key of the entity that can linked to multiple instances of the other entity must become the foreign key in that other entity. Example: The primary key for customer (which can occur only once per sale) is a foreign key in the sales table (which can occur many times for a particular customer).

Example: (1,1)-(1,1) Cash Receipt Sale (1,1) yields SaleID Date Amount CR-ID Could do either one but because the entities represent sequential events, authors follow the practice of placing the primary key of the event that occurs first (sale) as a foreign key in the event that occurs second (cash receipt). SaleID Date Amount S1 6/12 $10 S2 $15 S3 6/13 $12 CR-ID * CR1 CR2 CR3 CR-ID Date Amount CR1 6/12 $10 CR2 $15 CR3 6/13 $12 S-ID * S1 S2 S3

Example 2: Posting into a (1,1)-(0,1) Sale Cash Receipt yields (1,1) (0,1) SaleID Date Amount CR-ID SaleID Date Amount S1 6/12 $10 S2 $15 S3 6/13 $12 CR-ID* CR1 CR2 CR3 This eliminates null values CR-ID Date Amount CR1 6/12 $10 CR2 $15 CR3 6/13 $12 CR4 $1,000 S-ID* S1 S2 S3

Example : Posting into a one to many Sale Customer Is-to (1,1) (0,N) SaleID Date Amount CustID Name City SaleID Date Amount S1 6/12 $10 S2 $15 S3 6/13 $12 Cust-ID* C1 C2 Cincinnati Steven C2 Walnut Creek Heather C1 Address Name Cust-ID S2 S1, S3 S-ID* C3 Dave Cincinnati

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

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

Foreign key (field property required or not required) If minimum cardinality for foreign key posting is 1(mandatory), field property attribute should be set to required The six circled foreign key attributes field property should be set to required in the database table to avoid possibility of null value

Foreign keys in bold red should have property attribute set to required to avoid null value.

Foreign key (required or not required) Cardinalities indicate that Customer participation in relationship is mandatory. Since it is mandatory, to avoid possible null value, make this attribute required in the sales table

There are 4 relationship attributes. If relationship becomes a separate table, then relationship attributes are placed in that table If relationship established via foreign key, attribute placed in table with foreign key

Relationship attributes

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 for