Chapter 3: Data Modeling Introduction An Overview of Databases Steps in Developing a Database Using Resources, Events and Agents Model Normalization
Introduction Uses of a modern AIS Systematically record data Provide convenient and useful formats Easy access to information
What is a Database? Collection of organized data Used by many different computer applications Manipulated by database management systems (DBMS)
Significance of a Database Critical information Volume Distribution Privacy Irreplaceable data Need for accuracy Internet uses
Storing Data in Databases Data must be stored and organized systematically Three important concepts: Data hierarchy Record structures Database keys
Data Hierarchy Data organization in ascending order: Data field Record File Database
Record Structures Data fields in each record of a database table Structure is usually fixed Example
Database Keys Primary Key Foreign Keys Unique to each record Enable referencing of one or more records Matches primary key of related table
Records Combined Into Report
Additional Database Issues Administration Database Administrator Documentation Includes a variety of descriptions Structures, Contents, Security Features Data Dictionary Metadata
Data Dictionary Example
Additional Database Issues Data Integrity Data Integrity controls Designed by database developers Processing Accuracy and Completeness Transaction controls Ensures accurate transaction processing
Additional Database Issues Concurrency Concurrency controls Prevent multi-user access at same time Backup and Security Ability to recreate data Prevent unauthorized access View controls
Study Break #1 The part of the data hierarchy that represents one instance of an entity is a: Field Record File Database
Study Break #1 - Answer The part of the data hierarchy that represents one instance of an entity is a: Field Record File Database
Study Break #2 Within the context of databases, the term “concurrency” refers to the possibility that: A customer of one store might also be a customer of another store Two database users might want to access the same record at the same time A credit entry for a customer requires a debit entry for a matching account None of these
Study Break #2 - Answer Within the context of databases, the term “concurrency” refers to the possibility that: A customer of one store might also be a customer of another store Two database users might want to access the same record at the same time A credit entry for a customer requires a debit entry for a matching account None of these
REA Model Resources Events Agents Organization’s assets Activities associated with a business processes Agents People associated with business activities
Steps in Developing Databases with REA Identify Business and Economic Events Identify Entities Identify Relationships Among Entities
Steps in Developing Databases with REA Create Entity-Relationship Diagrams Identify Attributes of Entities Convert E-R Diagrams into Database Tables
Identify Events and Entities Types of Events Business Economic Types of Database Entities Entities Agents Resources
Entity Examples
Identify Relationships Among Entities Types of Relationships Direct relationship Indirect relationship Cardinalities Nature of relationships among entities
Cardinality Relationships Notations One-to-one (1:1) One-to-many (1:N) Many-to-many (N:N) Purpose Occurrence of one entity Associated with occurrence of one event of another entity
Cardinality Relationships
Entity-Relationship Diagram Purpose Diagram entities Relationships among entities Structure Rectangles represent entities Connecting lines represent relationships
E-R Diagram Example
Relationship Tables Provide greater flexibility Need for Relationship Tables Linking tables with foreign keys Many-to-many relationships
Relationship Tables
Schematic of Database Tables
Study Break #3 In the REA model, the “A” stands for: Agents Additions Accounts Associations
Study Break #3 - Answer In the REA model, the “A” stands for: Agents Additions Accounts Associations
Study Break #4 Which of these is not a cardinality between two database entities? One-to-one None-to-none One-to-many Many-to-many
Study Break #4 - Answer Which of these is not a cardinality between two database entities? One-to-one None-to-none One-to-many Many-to-many
Normalization Normalization Levels Methodology ensuring attributes are stored in most appropriate tables Design promotes accuracy Avoids redundancy of data storage Levels First normal form Second normal form Third normal form
Unnormalized Data
First Normal Form In First Normal Form (1 NF) when: Problems All data fields are singular Each attribute has one value Problems Data redundancy Insertion anomaly Deletion anomaly
First Normal Form Example
Second Normal Form In Second Normal Form (2 NF) when: Benefits It is in 1 NF All data items depend on primary record key Benefits More efficient design Eliminates data redundancy
Second Normal Form Example
Third Normal Form In Third Normal Form (3 NF) when: Ultimate Goal It is in 2 NF Does not contain transitive dependencies Data field A does not determine data field B Ultimate Goal Create database in 3 NF
Third Normal Form Example
Study Break #5 A database is in third normal form (3NF) if it is second normal form and: All the data attributes in a record are well defined All the data attributes in a record depend on the record key The data contain to transitive dependencies The data can be stored in two or more separate tables
Study Break #5 - Answer A database is in third normal form (3NF) if it is second normal form and: All the data attributes in a record are well defined All the data attributes in a record depend on the record key The data contain to transitive dependencies The data can be stored in two or more separate tables
Copyright Copyright 2012 John Wiley & Sons, Inc. All rights reserved. Reproduction or translation of this work beyond that permitted in Section 117 of the 1976 United States Copyright Act without the express written permission of the copyright owner is unlawful. Request for further information should be addressed to the Permissions Department, John Wiley & Sons, Inc. The purchaser may make backup copies for his/her own use only and not for distribution or resale. The Publisher assumes no responsibility for errors, omissions, or damages, caused by the use of these programs or from the use of the information contained herein.
Chapter 3