Published on

Published in: Technology
  • Be the first to comment

  • Be the first to like this

No Downloads
Total views
On SlideShare
From Embeds
Number of Embeds
Embeds 0
No embeds

No notes for slide
  • 1
  • 31
  • 3 Users access data via computer programs that process the data and present information to the users. Users own their data files . Data redundancy results as multiple applications maintain the same data elements. Files and data elements used in more than one application must be duplicated, which results in data redundancy . As a result of redundancy, the characteristics of data elements and their values are likely to be inconsistent . Outputs usually consist of preprogrammed reports instead of ad-hoc queries provided upon request. This results in inaccessibility of data. Changes to current file-oriented applications cannot be made easily, nor can new developments be quickly realized, which results in inflexibility .
  • 4
  • 6 Solves the following problems of the flat file approach no data redundancy - except for primary keys, data is only stored once single update current values task-data independence - users have access to the full domain of data available to the firm A database is a set of computer files that minimizes data redundancy and is accessed by one or more application programs for data processing. The database approach to data storage applies whenever a database is established to serve two or more applications, organizational units, or types of users. A database management system (DBMS) is a computer program that enables users to create, modify, and utilize database information efficiently.
  • 8
  • 10
  • 7
  • 11
  • 12
  • 13
  • 31
  • 35
  • 32
  • 23
  • 33
  • 79
  • 38
  • 38
  • 86
  • 40
  • 23
  • Decentralization does not attempt to integrate the parts into a logical whole unit.
  • Ch09

    1. 1. Chapter 9 Database Management Systems
    2. 2. Objectives for Chapter 9 <ul><li>Operational problems inherent in the flat file approach to data management that gave rise to the database concept </li></ul><ul><li>The relationships among the defining elements of the database environment </li></ul><ul><li>The anomalies caused by unnormalized databases and the need for data normalization </li></ul><ul><li>The stages in database design including entity identification, data modeling, constructing the physical database, and preparing user views </li></ul><ul><li>The operational features of distributed databases and recognize the issues that need to be considered in deciding on a particular database configuration </li></ul>
    3. 3. Flat-File Versus Database Environments <ul><li>Computer processing involves two components: data and instructions (programs). </li></ul><ul><li>Conceptually, there are two methods for designing the interface between program instructions and data: </li></ul><ul><ul><li>file-oriented processing: A specific data file was created for each application </li></ul></ul><ul><ul><li>data-oriented processing: Create a single data repository to support numerous applications. </li></ul></ul><ul><li>Disadvantages of file-oriented processing include redundant data and programs and varying formats for storing the redundant data. </li></ul><ul><li>The format for similar fields may vary because the programmer used inconsistent field formats. </li></ul>
    4. 4. Flat-File Environment 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
    5. 5. Data Redundancy & Flat-File Problems <ul><li>Data Storage - creates excessive storage costs of paper documents and/or magnetic form </li></ul><ul><li>Data Updating - any changes or additions must be performed multiple times </li></ul><ul><li>Currency of Information - potential problem of failing to update all affected files </li></ul><ul><li>Task-Data Dependency - user’s inability to obtain additional information as his or her needs change </li></ul>
    6. 6. Program 1 Program 2 Program 3 User 2 Transactions User 1 Transactions User 3 Transactions Database D B M S A, B, C, X, Y, L, M Database Approach
    7. 7. Advantages of the Database Approach <ul><li>Data sharing/centralize database resolves flat-file problems: </li></ul><ul><li>No data redundancy - Data is stored only once, eliminating data redundancy and reducing storage costs. </li></ul><ul><li>Single update - Because data is in only one place, it requires only a single update procedure, reducing the time and cost of keeping the database current. </li></ul><ul><li>Current values - A change to the database made by any user yields current data values for all other users. </li></ul><ul><li>Task-data independence - As users’ information needs expand beyond their immediate domain, the new needs can be more easily satisfied than under the flat-file approach. </li></ul>
    8. 8. Disadvantages of the Database Approach <ul><li>Can be costly to implement </li></ul><ul><ul><li>additional hardware, software, storage, and network resources are required </li></ul></ul><ul><li>Can only run in certain operating environments </li></ul><ul><ul><li>may make it unsuitable for some system configurations </li></ul></ul><ul><li>Because it is so different from the file-oriented approach, the database approach requires training users </li></ul><ul><ul><li>may be inertia or resistance </li></ul></ul>
    9. 9. Elements of the Database Approach System Development Process Database Administrator U S E R S DBMS Host Operating System Physical Database User Programs User Programs User Programs Applications Data Definition Language Data Manipulation Language Query Language User Queries Transactions Transactions Transactions System Requests
    10. 10. DBMS Features <ul><li>User Programs - makes the presence of the DBMS transparent to the user </li></ul><ul><li>Direct Query - allows authorized users to access data without programming </li></ul><ul><li>Application Development - user created applications </li></ul><ul><li>Backup and Recovery - copies database </li></ul><ul><li>Database Usage Reporting - captures statistics on database usage (who, when, etc.) </li></ul><ul><li>Database Access - authorizes access to sections of the database </li></ul>
    11. 11. Internal Controls and DBMS <ul><li>The purpose of the DBMS is to provide controlled access to the database. </li></ul><ul><li>The DBMS is a special software system programmed to know which data elements each user is authorized to access and deny unauthorized requests of data . </li></ul>
    12. 12. Data Definition Language (DDL) <ul><li>DDL is a programming language used to define the database to the DBMS. </li></ul><ul><li>The DDL identifies the names and the relationship of all data elements, records, and files that constitute the database. </li></ul><ul><li>Viewing Levels: </li></ul><ul><ul><li>internal view - physical arrangement of records ( 1 ) </li></ul></ul><ul><ul><li>conceptual view - representation of database ( 1 ) </li></ul></ul><ul><ul><li>user view - the portion of the database each user views ( many ) </li></ul></ul>
    13. 13. Data Manipulation Language (DML) <ul><li>DML is the proprietary programming language that a particular DBMS uses to retrieve, process, and store data. </li></ul><ul><li>Entire user programs may be written in the DML, or selected DML commands can be inserted into universal programs, such as COBOL and FORTRAN. </li></ul>
    14. 14. Query Language <ul><li>The query capability permits end users and professional programmers to access data in the database without the need for conventional programs. </li></ul><ul><li>ANSI’s Structured Query Language (SQL) is a fourth-generation language that has emerged as the standard query language. </li></ul>
    15. 15. Functions of the DBA
    16. 16. Logical Data Structures <ul><li>A particular method used to organize records in a database is called the database’s structure. </li></ul><ul><li>The objective is to develop this structure efficiently so that data can be accessed quickly and easily. </li></ul><ul><li>Four types of structures are: </li></ul><ul><ul><li>hierarchical (aka the tree structure) </li></ul></ul><ul><ul><li>network </li></ul></ul><ul><ul><li>relational </li></ul></ul><ul><ul><li>object-oriented </li></ul></ul>
    17. 17. The Relational Model <ul><li>The relational model portrays data in the form of two dimensional tables: </li></ul><ul><ul><li>relation - the database table </li></ul></ul><ul><ul><li>attributes (data elements) - form columns </li></ul></ul><ul><ul><li>tuples (records) - form rows </li></ul></ul><ul><ul><li>data - the intersection of rows and columns </li></ul></ul>
    18. 18. PROJECT - filtering out columns, such as the green Z3 JOIN RESTRICT - filtering out rows, such as the yellow X1 X1 X2 X2 X3 X3 Y1 Y1 Y1 Y1 Y1 Y2 Y2 Y2 Y3 Z1 Z1 Z2 Z2 Z1
    19. 19. Properly Designed Relational Tables <ul><li>No repeating values - All occurrences at the intersection of a row and column are a single value. </li></ul><ul><li>The attribute values in any column must all be of the same class. </li></ul><ul><li>Each column in a given table must be uniquely named. </li></ul><ul><li>Each row in the table must be unique in at least one attribute, which is the primary key. </li></ul>
    20. 20. Crow’s Feet Cardinalities (1:0,1) (1:1) (1:0,M) (1:M) (M:M)
    21. 21. Relational Model Data Linkages (>1 table) <ul><li>No explicit pointers are present. The data are viewed as a collection of independent tables. </li></ul><ul><li>Relations are formed by an attribute that is common to both tables in the relation. </li></ul><ul><li>Assignment of foreign keys: </li></ul><ul><ul><li>if 1 to 1 association, either of the table’s primary key may be the foreign key. </li></ul></ul><ul><ul><li>if 1 to many association, the primary key on one of the sides is embedded as the foreign key on the other side. </li></ul></ul><ul><ul><li>if many to many association, may embed foreign keys or create a separate linking table. </li></ul></ul>
    22. 22. Three Types of Anomalies <ul><li>Insertion Anomaly : A new item cannot be added to the table until at least one entity uses a particular attribute item. </li></ul><ul><li>Deletion Anomaly : If an attribute item used by only one entity is deleted, all information about that attribute item is lost. </li></ul><ul><li>Update Anomaly : A modification on an attribute must be made in each of the rows in which the attribute appears. </li></ul><ul><li>Anomalies can be corrected by creating relational tables . </li></ul>
    23. 23. Advantages of Relational Tables <ul><li>Removes all three anomalies </li></ul><ul><li>Various items of interest (customers, inventory, sales) are stored in separate tables. </li></ul><ul><li>Space is used efficiently. </li></ul><ul><li>Very flexible. Users can form ad hoc relationships. </li></ul>
    24. 24. The Normalization Process <ul><li>A process which systematically splits unnormalized complex tables into smaller tables that meet two conditions: </li></ul><ul><ul><li>all nonkey (secondary) attributes in the table are dependent on the primary key </li></ul></ul><ul><ul><li>all nonkey attributes are independent of the other nonkey attributes </li></ul></ul><ul><li>When unnormalized tables are split and reduced to third normal form, they must then be linked together by foreign keys. </li></ul>
    25. 25. Steps in Normalization Table with repeating groups First normal form 1NF Second normal form 2NF Third normal form 3NF Higher normal forms Remove repeating groups Remove partial dependencies Remove transitive dependencies Remove remaining anomalies
    26. 26. Accountants and Data Normalization <ul><li>The update anomaly can generate conflicting and obsolete database values . </li></ul><ul><li>The insertion anomaly can result in unrecorded transactions and incomplete audit trails . </li></ul><ul><li>The deletion anomaly can cause the loss of accounting records and the destruction of audit trails. </li></ul><ul><li>Accountants should have an understanding of the data normalization process and be able to determine whether a database is properly normalized. </li></ul>
    27. 27. Six Phases in Designing Relational Databases <ul><li>Identify entities </li></ul><ul><ul><li>identify the primary entities of the organization </li></ul></ul><ul><ul><li>construct a data model of their relationships </li></ul></ul><ul><li>Construct a data model showing entity associations </li></ul><ul><ul><li>determine the associations between entities </li></ul></ul><ul><ul><li>model associations into an ER diagram </li></ul></ul>
    28. 28. Six Phases in Designing Relational Databases <ul><li>Add primary keys and attributes to the model </li></ul><ul><ul><li>assign primary keys to all entities in the model to uniquely identify records </li></ul></ul><ul><ul><li>every attribute should appear in one or more user views </li></ul></ul><ul><li>Normalize the data model and add foreign keys </li></ul><ul><ul><li>remove repeating groups, partial and transitive dependencies </li></ul></ul><ul><ul><li>assign foreign keys to be able to link tables </li></ul></ul>
    29. 29. Six Phases in Designing Relational Databases <ul><li>Construct the physical database </li></ul><ul><ul><li>create physical tables </li></ul></ul><ul><ul><li>populate tables with data </li></ul></ul><ul><li>Prepare the user views </li></ul><ul><ul><li>normalized tables should support all required views of system users </li></ul></ul><ul><ul><li>user views restrict users from have access to unauthorized data </li></ul></ul>
    30. 30. Distributed Data Processing <ul><ul><li>Site C </li></ul></ul><ul><ul><li>Site B </li></ul></ul><ul><ul><li>Site A </li></ul></ul>Centralized Database Central Site
    31. 31. Distributed Data Processing <ul><li>DP is organized around several information processing units (IPUs) distributed throughout the organization and placed under the control of the end users. </li></ul><ul><li>DDP does not mean decentralization </li></ul><ul><ul><li>IPUs are connected to one another and coordinated </li></ul></ul>
    32. 32. Potential Advantages of DDP <ul><li>Cost reductions in hardware and data entry tasks </li></ul><ul><li>Improved cost control responsibility </li></ul><ul><li>Improved user satisfaction since control is closer to the user level </li></ul><ul><li>Backup of data can be improved through the use of multiple data storage sites </li></ul>
    33. 33. Potential Disadvantages of DDP <ul><li>Loss of control </li></ul><ul><li>Mismanagement of organization-wide resources </li></ul><ul><li>Hardware and software incompatibility </li></ul><ul><li>Redundant tasks and data </li></ul><ul><li>Consolidating incompatible tasks </li></ul><ul><li>Difficulty attracting qualified personnel </li></ul><ul><li>Lack of standards </li></ul>
    34. 34. <ul><li>The data is retained in a central location. </li></ul><ul><li>Remote IPUs send requests for data. </li></ul><ul><li>Central site services the needs of the remote IPUs. </li></ul><ul><li>The actual processing of the data is performed at the remote IPU. </li></ul>Centralized Databases in DDP Environment
    35. 35. Data Currency <ul><li>Occurs in DDP with a centralized database </li></ul><ul><li>During transaction processing, the data will temporarily be inconsistent as a record is being read and updated. </li></ul><ul><li>Database lockout procedures are necessary to keep IPUs from reading inconsistent data and from writing over a transaction being written by another IPU. </li></ul>
    36. 36. Distributed Databases: Partitioning <ul><li>Splits the central database into segments that are distributed to their primary users </li></ul><ul><li>Advantages: </li></ul><ul><ul><li>users’ control is increased by having data stored at local sites </li></ul></ul><ul><ul><li>transaction processing response time is improved </li></ul></ul><ul><ul><li>the volume of transmitted data between IPUs is reduced </li></ul></ul><ul><ul><li>reduces the potential data loss from a disaster </li></ul></ul>
    37. 37. The Deadlock Phenomenon <ul><li>Especially a problem with partitioned databases </li></ul><ul><li>Occurs when multiple sites lock each other out of data that they are currently using </li></ul><ul><ul><li>One site needs data locked by another site. </li></ul></ul><ul><li>Special software is needed to analyze and resolve conflicts. </li></ul><ul><ul><li>Transactions may be terminated and have to be restarted. </li></ul></ul>
    38. 38. The Deadlock Phenomenon A,B E, F C,D Locked A, waiting for C Locked C, waiting for E Locked E, waiting for A
    39. 39. Distributed Databases: Replication <ul><li>The duplication of the entire database for multiple IPUs </li></ul><ul><li>This method is effective for situations with a high degree of data sharing, but no primary user, and supports read-only queries. </li></ul><ul><li>The data traffic between sites is reduced considerably. </li></ul>
    40. 40. Concurrency Problems and Control Issues <ul><li>Database concurrency is the presence of complete and accurate data at all IPU sites. With replicated databases, maintaining current data at all locations is a difficult task. </li></ul><ul><li>Time stamping may be used to serialize transactions and to prevent and resolve any potential conflicts created by updating data at various IPUs. </li></ul>