Download presentation
Presentation is loading. Please wait.
Published byJohn Snow Modified over 8 years ago
1
Hall, Accounting Information Systems, 7e ©2011 Cengage Learning. All Rights Reserved. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part. Accounting Information Systems, 7e James A. Hall Chapter 9 Database Management Systems
2
Hall, Accounting Information Systems, 7e ©2011 Cengage Learning. All Rights Reserved. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part. Objectives for Chapter 9 Understand the operational problems inherent in the flat-file approach to data management that gave rise to the database concept. Understand the relationships among the defining elements of the database environment. Understand the anomalies caused by unnormalized databases and the need for data normalization. Be familiar with the stages in database design, including entity identification, data modeling, constructing the physical database, and preparing user views. Be familiar with the operational features of distributed databases and recognize the issues that need to be considered in deciding on a particular database configuration. 2
3
Hall, Accounting Information Systems, 7e ©2011 Cengage Learning. All Rights Reserved. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part. Flat-File Versus Database Environments Computer processing involves two components: data and instructions (programs). Conceptually, there are two methods for designing the interface between program instructions and data: File-oriented processing: A specific data file was created for each application. Data-oriented processing: Create a single data repository to support numerous applications. Disadvantages of file-oriented processing include redundant data and programs varying formats for storing the redundant data 3
4
Hall, Accounting Information Systems, 7e ©2011 Cengage Learning. All Rights Reserved. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part. Flat-File Data Management Program 1 Program 2 Program 3 A,B,C X,B,Y L,B,M User 2 Transactions User 1 Transactions User 3 Transactions Data 4 Figure 9-1
5
Hall, Accounting Information Systems, 7e ©2011 Cengage Learning. All Rights Reserved. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part. Data Redundancy and Flat-File Problems Data Storage - creates excessive storage costs of paper documents and/or magnetic form. Data Updating - any changes or additions must be performed multiple times. Currency of Information – has the potential problem of failing to update all affected files. Task-Data Dependency - user unable to obtain additional information as his or her needs change 5
6
Hall, Accounting Information Systems, 7e ©2011 Cengage Learning. All Rights Reserved. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part. Program 1 Program 2 Program 3 User 2 Transactions User 1 Transactions User 3 Transactions Database DBMSDBMS A, B, C, X, Y, L, M The Database Concept 6 Figure 9-2(b)
7
Hall, Accounting Information Systems, 7e ©2011 Cengage Learning. All Rights Reserved. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part. Advantages of the Database Approach Data sharing/centralized database resolves flat-file problems: No data redundancy: Data is stored only once, eliminating data redundancy and reducing storage costs. Single update: Because data is in only one place, it requires only a single update, reducing the time and cost of keeping the database current. Current values: A change to the database made by any user yields current data values for all other users. Task-data independence: As users’ information needs expand, the new needs can be more easily satisfied than under the flat-file approach. 7
8
Hall, Accounting Information Systems, 7e ©2011 Cengage Learning. All Rights Reserved. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part. Disadvantages of the Database Approach Can be costly to implement additional hardware, software, storage, and network resources are required. Can only run in certain operating environments may make it unsuitable for some system configurations. Because it is so different from the file-oriented approach, the database approach requires training users may be inertia or resistance. 8
9
Hall, Accounting Information Systems, 7e ©2011 Cengage Learning. All Rights Reserved. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part. 9 Elements of the Database Environment Figure 9-3
10
Hall, Accounting Information Systems, 7e ©2011 Cengage Learning. All Rights Reserved. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part. Internal Controls and DBMS The database management system stands between the user and the database per se. Thus, commercial DBMS’s (e.g., Access or Oracle) actually consist of a database plus… software to manage the database, especially controlling access and other internal controls software to generate reports, create data-entry forms, etc. The DBMS has special software to control which data elements each user is authorized to access. 10
11
Hall, Accounting Information Systems, 7e ©2011 Cengage Learning. All Rights Reserved. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part. DBMS Features Program Development - user created applications Backup and Recovery - copies database. Database Usage Reporting - captures statistics on database usage (who, when, etc.). Database Access - authorizes access to sections of the database. Also… User Programs - makes the presence of the DBMS transparent to the user. Direct Query - allows authorized users to access data without programming. 11
12
Hall, Accounting Information Systems, 7e ©2011 Cengage Learning. All Rights Reserved. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part. Data Definition Language (DDL) DDL is a programming language used to define the database per se. It identifies the names and the relationship of all data elements, records, and files that constitute the database.(eg, Create table, Drop, Alter etc..) DDL defines the database on three viewing levels Internal view – physical arrangement of records (1 view) Conceptual view (schema) – representation of database (1 view) User view (subschema) – the portion of the database each user views (many views) 12
13
Hall, Accounting Information Systems, 7e ©2011 Cengage Learning. All Rights Reserved. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part. Overview of DBMS Operation 13 Figure 9-4
14
Hall, Accounting Information Systems, 7e ©2011 Cengage Learning. All Rights Reserved. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part. Data Manipulation Language (DML) DML is the proprietary programming language that a particular DBMS uses to insert, delete and update data to / from the database. Entire user programs may be written in the DML, or selected DML commands can be inserted into universal programs, such as COBOL and FORTRAN. Can be used to ‘patch’ third party applications to the DBMS 14
15
Hall, Accounting Information Systems, 7e ©2011 Cengage Learning. All Rights Reserved. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part. Query Language The query capability permits end users and professional programmers to access data in the database without the need for conventional programs. Can be an internal control issue since users may be making an ‘end run’ around the controls built into the conventional programs IBM’s structured query language (SQL) is a fourth-generation language that has emerged as the standard query language. Adopted by ANSI as the standard language for all relational databases 15
16
Hall, Accounting Information Systems, 7e ©2011 Cengage Learning. All Rights Reserved. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part. Functions of the DBA 16
17
Hall, Accounting Information Systems, 7e ©2011 Cengage Learning. All Rights Reserved. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part. Database Conceptual Models Refers to the particular method used to organize records in a database. a.k.a. “logical data structures” Objective: develop the database efficiently so that data can be accessed quickly and easily. There are three main models: hierarchical (tree structure) network relational Most existing databases are relational. Some legacy systems use hierarchical or network databases. 17
18
Hall, Accounting Information Systems, 7e ©2011 Cengage Learning. All Rights Reserved. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part. The Relational Model The relational model portrays data in the form of two dimensional ‘tables’. Its strength is the ease with which tables may be linked to one another. a major weakness of hierarchical and network databases Relational model is based on the relational algebra functions of restrict, project, and join. 18
19
Hall, Accounting Information Systems, 7e ©2011 Cengage Learning. All Rights Reserved. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part. 19 The Relational Algebra Functions Restrict, Project, and Join Figure 9-9
20
Hall, Accounting Information Systems, 7e ©2011 Cengage Learning. All Rights Reserved. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part. 20 The Relational Algebra Functions Restrict, Project, and Join Restrict: Extracts specified rows from a specified table. This operation, illustrated in Figure 9.9(a), creates a virtual table (one that does not physically exist) that is a subset of the original table. Project: Extracts specified attributes (columns) from a table to create a virtual table. This is presented in Figure 9.9(b). Join: Builds a new physical table from two tables consisting of all concatenated pairs of rows, from each table,
21
Hall, Accounting Information Systems, 7e ©2011 Cengage Learning. All Rights Reserved. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part. Associations and Cardinality Association Represented by a line connecting two entities Described by a verb, such as ships, requests, or receives Cardinality – the degree of association between two entities The number of possible occurrences in one table that are associated with a single occurrence in a related table Used to determine primary keys and foreign keys 21
22
Hall, Accounting Information Systems, 7e ©2011 Cengage Learning. All Rights Reserved. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part. 22 Examples of Entity Associations Figure 9-11
23
Hall, Accounting Information Systems, 7e ©2011 Cengage Learning. All Rights Reserved. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part. Properly Designed Relational Tables Each row in the table must be unique in at least one attribute, which is the primary key. Tables are linked by embedding the primary key into the related table as a foreign key. The attribute values in any column must all be of the same class or data type. Each column in a given table must be uniquely named. Tables must conform to the rules of normalization, i.e., free from structural dependencies or anomalies. 23
24
Hall, Accounting Information Systems, 7e ©2011 Cengage Learning. All Rights Reserved. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part. 24
25
Hall, Accounting Information Systems, 7e ©2011 Cengage Learning. All Rights Reserved. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part. Three Types of Anomalies Update Anomaly: The update anomaly results from data redundancy in an unnormalized table. Eg, data attributes pertaining to Supplier Number 22 (Name, Address, and Tele Num) are repeated in every record of every inventory item that Supplier Number 22 provides. Any change in the supplier’s name, address, or telephone number must be made to each of these records in the table. 25
26
Hall, Accounting Information Systems, 7e ©2011 Cengage Learning. All Rights Reserved. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part. Three Types of Anomalies Insertion Anomaly: To demonstrate the effects of the insertion anomaly, assume that a new vendor has entered the marketplace. The organization does not yet purchase from the vendor, but may wish to do so in the future. In the meantime, the organization wants to add the vendor to the database. This is not possible, however, because the primary key for the Inventory table is PART NUM. Because the vendor does not supply the organization with any inventory items, the supplier data cannot be added to the table. 26
27
Hall, Accounting Information Systems, 7e ©2011 Cengage Learning. All Rights Reserved. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part. Three Types of Anomalies Deletion Anomaly: The deletion anomaly involves the unintentional deletion of data from a table. To illustrate, assume that Supplier Number 27 provides the company with only one item: Part Num- ber 1. If the organization discontinues this item of inventory and deletes it from the table, the data pertaining to Supplier Number 27 will also be deleted. Although the company may wish to retain the supplier’s information for future use, the current table design prevents it from doing so. Anomalies can be corrected by creating additional relational tables. 27
28
Hall, Accounting Information Systems, 7e ©2011 Cengage Learning. All Rights Reserved. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part. Advantages of Relational Tables Removes all three types of anomalies. Various items of interest (customers, inventory, sales) are stored in separate tables. Space is used efficiently. Very flexible – users can form ad hoc relationships. 28
29
Hall, Accounting Information Systems, 7e ©2011 Cengage Learning. All Rights Reserved. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part. The Normalization Process A process which systematically splits unnormalized complex tables into smaller tables that meet two conditions: all nonkey (secondary) attributes in the table are dependent on the primary key all nonkey attributes are independent of the other nonkey attributes When unnormalized tables are split and reduced to third normal form, they must then be linked together by foreign keys. 29
30
Hall, Accounting Information Systems, 7e ©2011 Cengage Learning. All Rights Reserved. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part. Accountants and Data Normalization Update anomalies can generate conflicting and obsolete database values. Insertion anomalies can result in unrecorded transactions and incomplete audit trails. Deletion anomalies can cause the loss of accounting records and the destruction of audit trails. Accountants should understand the data normalization process and be able to determine whether a database is properly normalized. 30
31
Hall, Accounting Information Systems, 7e ©2011 Cengage Learning. All Rights Reserved. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part. Steps in the Normalization Process 31 Figure 9-34
32
Hall, Accounting Information Systems, 7e ©2011 Cengage Learning. All Rights Reserved. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part. Unnormalized table: 32
33
Hall, Accounting Information Systems, 7e ©2011 Cengage Learning. All Rights Reserved. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part. First Normal Form (1NF) 33
34
Hall, Accounting Information Systems, 7e ©2011 Cengage Learning. All Rights Reserved. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part. Second Normal Form (2NF) 34 Figure 9-34
35
Hall, Accounting Information Systems, 7e ©2011 Cengage Learning. All Rights Reserved. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part. Third Normal Form (3NF) 35 Figure 9-34
36
Hall, Accounting Information Systems, 7e ©2011 Cengage Learning. All Rights Reserved. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part. Linking normalized tables and foreign key addition 36 Figure 9-34
37
Hall, Accounting Information Systems, 7e ©2011 Cengage Learning. All Rights Reserved. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part. Six Phases in Designing Relational Databases 1.Identify entities 2. Construct a data model showing entity associations 1.Add primary keys and attributes 2.Normalize and add foreign keys 3.Construct the physical database 4.Prepare the user views
38
Hall, Accounting Information Systems, 7e ©2011 Cengage Learning. All Rights Reserved. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part. Six Phases in Designing Relational Databases 1.Identify entities entities are nouns in a system description; must meet the following two conditions: an entity must consist of two or more occurances an entity must contribute at least 1 attribute that is not provided through other entities consider the following system description: "The purchasing agent reviews the inventory status report for items that need to be reordered. The agent selects a supplier and prepares an online purchase order.... " Purchasing agent: meets condition-1 as the company has more than 1 purchasing agent. However, as purchasing agent is an employee and already has data in the employee table there is no unique data that can be entered into purchasing agent table. So it does not meet condition-2. Inventory: meets both the conditions, so is a valid entity.
39
Hall, Accounting Information Systems, 7e ©2011 Cengage Learning. All Rights Reserved. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part. Six Phases in Designing Relational Databases 2. Construct a data model showing entity associations determine the associations between entities model associations into an ER diagram Entity association in the following Data model: Purchase order:inventory (0,M:M), Inventory:supplier (M:M), supplier:purchase ord (1:0,M), purchase ord:receiving report (1:1), Receiving report:inventory(0,M:M) M:M and 0,M:M relations need to be resolved as these associations signify a missing entity that is needed to link them
40
Hall, Accounting Information Systems, 7e ©2011 Cengage Learning. All Rights Reserved. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part. 40 Six Phases in Designing Relational Databases 3. Add primary keys and attributes assign primary keys to all entities to uniquely identify records every attribute should appear in one or more user views; ie, to be used by the users otherwise it serves no purpose and to be removed
41
Hall, Accounting Information Systems, 7e ©2011 Cengage Learning. All Rights Reserved. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part. 41 4. Normalize (by removing the following) and add foreign keys : Repeating Group Data in Purchase Order : Part Number, Description, Order Quantity, and Unit Cost are repeating group data. As a particular purchase order contains more than one item, multiple values will need to be captured for these attributes. To resolve this, repeating group data were removed to a new PO Item Detail entity, where, a primary key is a COMPOSITE of Part Number and PO Number; which also resolved the M:M association issue. Repeating Group Data in Receiving Report: Part Number, Quantity Received, and Condition Code are repeating attributes in the Receiving Report entity and were removed to a new entity called Rec Report Item Detail. A COMPOSITE KEY composed of PART NUMBER and REC REPT NUMBER was assigned. This resolved the M:M association between Receiving Report and Inventory. Transitive Dependencies: The Purchase Order and Receiving Report entities contain attributes that are redundant with data in the Inventory and Supplier entities. These redundancies occur because of transitive dependencies in the Purchase Order and Receiving Report entities and are dropped. Six Phases in Designing Relational Databases
42
Hall, Accounting Information Systems, 7e ©2011 Cengage Learning. All Rights Reserved. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part. 42 Six Phases in Designing Relational Databases Normalized data model with foreign keys
43
Hall, Accounting Information Systems, 7e ©2011 Cengage Learning. All Rights Reserved. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part. Six Phases in Designing Relational Databases 5.Construct the physical database create physical tables populate tables with data 6.Prepare the user views normalized tables should support all required views of system users user views restrict users from having access to unauthorized data 43
44
Hall, Accounting Information Systems, 7e ©2011 Cengage Learning. All Rights Reserved. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part. Distributed Data Processing (DDP) Data processing is organized around several information processing units (IPUs) distributed throughout the organization. Each IPU is placed under the control of the end user. DDP does not always mean total decentralization. IPUs in a DDP system are still connected to one another and coordinated. Typically, DDP’s use a centralized database. Alternatively, the database can be distributed, similar to the distribution of the data processing capability. 44
45
Hall, Accounting Information Systems, 7e ©2011 Cengage Learning. All Rights Reserved. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part. Centralized Databases in DDP Environment The data is retained in a central location. Remote IPUs send requests for data. Central site services the needs of the remote IPUs. The actual processing of the data is performed at the remote IPU. 45
46
Hall, Accounting Information Systems, 7e ©2011 Cengage Learning. All Rights Reserved. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part. Advantages of DDP Cost reductions in hardware and data entry tasks Improved cost control responsibility Improved user satisfaction since control is closer to the user level Backup of data can be improved through the use of multiple data storage sites 46
47
Hall, Accounting Information Systems, 7e ©2011 Cengage Learning. All Rights Reserved. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part. Disadvantages of DDP Loss of control Mismanagement of resources Hardware and software incompatibility Redundant tasks and data Consolidating incompatible tasks Difficulty attracting qualified personnel Lack of standards 47
48
Hall, Accounting Information Systems, 7e ©2011 Cengage Learning. All Rights Reserved. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part. Data Currency Occurs in DDP with a centralized database During transaction processing, data will temporarily be inconsistent as records are read and updated. Database lockout procedures are necessary to keep IPUs from reading inconsistent data and from writing over a transaction being written by another IPU. 48
49
Hall, Accounting Information Systems, 7e ©2011 Cengage Learning. All Rights Reserved. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part. Distributed Databases: Partitioning Splits the central database into segments that are distributed to their primary users. Advantages: users’ control is increased by having data stored at local sites. transaction processing response time is improved. volume of transmitted data between IPUs is reduced. reduces the potential data loss from a disaster. 49
50
Hall, Accounting Information Systems, 7e ©2011 Cengage Learning. All Rights Reserved. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part. The Deadlock Phenomenon Especially a problem with partitioned databases Occurs when multiple sites lock each other out of data that they are currently using. One site needs data locked by another site. Special software is needed to analyze and resolve conflicts. Transactions may be terminated and restarted. 50
51
Hall, Accounting Information Systems, 7e ©2011 Cengage Learning. All Rights Reserved. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part. The Deadlock Condition 51 Figure 9-26
52
Hall, Accounting Information Systems, 7e ©2011 Cengage Learning. All Rights Reserved. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part. Distributed Databases: Replication The duplication of the entire database for multiple IPUs Effective for situations with a high degree of data sharing, but no primary user Supports read-only queries Data traffic between sites is reduced considerably. 52
53
Hall, Accounting Information Systems, 7e ©2011 Cengage Learning. All Rights Reserved. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part. Replicated database approach: 53
54
Hall, Accounting Information Systems, 7e ©2011 Cengage Learning. All Rights Reserved. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part. Replicated database updated independently: 54
55
Hall, Accounting Information Systems, 7e ©2011 Cengage Learning. All Rights Reserved. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part. Concurrency Problems and Control Issues Database concurrency is the presence of complete and accurate data at all IPU sites. With replicated databases, maintaining current data at all locations is difficult. Time stamping is used to serialize transactions. Prevents and resolves conflicts created by updating data at various IPUs. 55
56
Hall, Accounting Information Systems, 7e ©2011 Cengage Learning. All Rights Reserved. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part. Distributed Databases and the Accountant The following database options impact the organization’s ability to maintain database integrity, to preserve audit trails, and to have accurate accounting records. Centralized or distributed data? If distributed, replicated or partitioned? If replicated, total or partial replication? If partitioned, what is the allocation of the data segments among the sites? 56
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.