Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
Classical Model
MSAccess
Accounting 475
Logical Modeling
Database Overall Schema
Flowchart
Entity-Relationship Diagram
Flowchart
Entity-Relationship Diagram
Accounting 475
Accounting 475
Logical Modeling
Database Overall Schema
Flowchart
Entity-Relationship Diagram
Physical Modeling Design of relational database tables Coding Create database in MSAccess
Accounting 475 Accounting 475
Data Flow Diagram Flowchart Comparison Computer Processing Magnetic Tape DFD Flowchart
Data Flow Diagram Flowchart Comparison Computer Processing Magnetic Disk DFD Flowchart
Accounting 475
Accounting 475
ERD Modeling
Makes sure that the database captures and stores data about each business activity the company intends to plan, control or evaluate It produces a database that is in third normal form (3NF)
Sale
Order
Accounting 475
Accounting 475
Invoice #
Telephone Number
Pays for
Made to
Accounting 475
Accounting 475
Unary Relationship
1 Employee Is married to
Name
Address
Telephone #
Accounting 475 Accounting 475
Employee 1
Item Sales Pays for
Is assigned to
Computer
Cash Collections
Customer Name
1
Price $ Amount
Office
Accounting 475
Accounting 475
Employers
Managed By
Supervisors
2 Simplifying Assumptions!!!
Customer Orders
Part of
Manages
Departments
Part of
Sales
Part of
Cash Receipts
Accounting 475
Accounting 475
Cash Collections
e.g. Cash Sale Each instance of a sale is linked to at most one instance of a cash collections event Each instance of a cash collection is linked to at most one instance of a sales event
Accounting 475
Cash Collections
e.g. Installment Payments Each instance of a sale is linked to many instances of a cash collection event Each instance of a cash collection is linked to at most one instance of a sales event event
Accounting 475
e.g. Paying monthly store card in full Each instance of a sale is linked to at most one instance of a cash collections event Each instance of a cash collection is linked to many instances of a sales event
Accounting 475
Cash Collections
e.g. Paying monthly store card in part each month (balance forward method) Each instance of a sale is linked to many instances of a cash collections event Each instance of a cash collection is linked to many instances of a sales event
Accounting 475
Accounting 475
ERD Methodology
Data Modeling Reading example
REA model
Event
Agent
Accounting 475
Types of people an organization collects data about, people who participate in events - employee, vendor, customer
Accounting 475
ERD Methodology
Data Modeling Reading example
ERD Methodology
Data Modeling Reading example
2. Draw rectangles to represent each entity and arrange event entities in chronological order on page (start with events and then add related resources and agents)
Resource Inventory Event Sales Agent Salesperson Customer Cash Cash Collections Cashier
Accounting 475
Event Sales
Pays for Party to Made to
Agent Salesperson
Customer
Cash
Increases
Cash Collections
Cashier
Accounting 475
ERD Methodology
Data Modeling Reading example
ERD Methodology
Data Modeling Reading example
Event N Sales N
Pays for
N N
Party to Made to
Event Sales
Pays for Party to Made to
Agent Salesperson
Cash
Increases
Customer
Cash Cashier
Accounting 475
Increases
Cash Collections
Cashier
Accounting 475
controls
Accounting 475
Accounting 475
Accounting 475
ERD Methodology
Data Modeling Reading example
Event-Resource Relationships
Inventory
Event 0 Sales
Pays for Party to Made to
Agent Salesperson
Line Item
Sales
Customer
Cash
Increases
Cash Collections
Cashier
Accounting 475
Every event involves the acquisition, use or disposal of some resource, but a resource may not be involved in any event Each instance of inventory is linked to a minimum of zero sales events (ie. Unsold or slow-moving inventory - managerial control) Each instance of a sale is linked to a minimum of one inventory item (sale w/o inventory indicates a transaction error) Accounting 475
ERD Methodology
Data Modeling Reading example
Event-Agent Relationships
Sale
Event Sales
Pays for
Party to Made to
Agent 1 Salesperson
Party to
Salesperson
Customer
Cash
Increases
Cash Collections
Cashier
Accounting 475
Ensures that all events are legitimate Each instance of a sale must be made by a minimum of one salesperson (sale w/o salesperson indicates a transaction error) Each salesperson is linked to a minimum of zero sales (ie. Person is not effective or was on vacation for the period, etc - managerial control.) Accounting 475
ERD Methodology
Data Modeling Reading example
Event-Event Relationships
Sales
Event Sales 1
Pays for Made to Party to
Agent Salesperson
Pays for
Cash Collection
Cash
Increases
0 Cash Collections
Customer
Cashier
Accounting 475
Ensures that events are legitimate and occur in proper order Each instance of a sale is linked to a minimum of zero cash collections (ie. uncollected A/R, overdue accounts, etc. managerial control) Each cash collection is linked to a minimum of one previous sale (cash collection without a previous sale indicates a transaction error)
Accounting 475
ERD Methodology
Data Modeling Reading example
Event 0 Sales 1
Pays for
0 0
Party to Made to
1 Salesperson 1 Customer
Relationships go through EVENTS; there are not Resource Agent relationships Only one
Cash
Increases
Cashier
Accounting 475 Accounting 475
Physical Modeling
Once the ERD is finished you convert this diagram into relational database tables Then apply Normalization rules and make sure the database is in desired normal form
Physical Modeling
ERD Conversion General Guidelines 1) Create tables for each Entity and N:N relationship 2) Primary key for entity table is a single numeric field; Primary key for N:N relationship table are two fields 3) Link the resulting tables
For tables in a 1:1 relationship, insert a foreign key in one of the two tables. In event-event relationships, put foreign key in later event table. For tables in a 1:N relationship, put foreign key in table of entity participating many times in relationship
Accounting 475
Accounting 475
Coding
1) Create and link tables in MSAccess 2) Create forms for each event process 3) Create forms for maintenance of each agent and resource entity 4) Create queries and reports for each information process
Accounting 475
END
Database Design: Logical & Physical Modeling
Database Accounting Systems Actg/IDS 475
In assigning cardinalities, use the normal guidelines, but remember: what determines the cardinalities are the business rules of the particular case!
Accounting 475
Accounting 475
Database Design
In a relational database we are collecting attributes in tables. Which attributes go in which tables and how are tables linked and queried? 2 basic approaches
Database Design
Approach 1
Gather attributes from current business documents (invoices, master files, etc.) Group into tables according to most likely dependencies, add keys Use normalization rules to adjust table design to eliminate anomalies Eliminate derived attributes
Accounting 475
Accounting 475
Database Design
Approach 2
Use the Entity Relationship Diagram (REA version) to model data Convert the ERD into schema (table design) and determine all attributes and keys Check design against normalization rules Eliminate derived attributes
END
Review of ERD Modeling and Database Design
Database Accounting Systems Actg/IDS 475
Accounting 475