What is a Database?• Collection of organized data • Used by many different computer applications • Manipulated by database management systems DBMS... Record Structures• Data fields in ea
Trang 1Prepared by Paula Funkhouser University of Nevada, Reno
Core Concepts of Accounting Information Systems, 13th Edition
Mark G Simkin ● Jacob M Rose ● Carolyn S Norman
Database Design
Chapter 7
Trang 2Chapter 7: Database Design
Trang 3• Uses of a modern AIS
– Systematically record data
– Provide convenient and useful formats
– Easy access to information
Trang 4What is a Database?
• Collection of organized data
• Used by many different computer applications
• Manipulated by database management systems (DBMS)
Trang 7Storing Data in Databases
Data must be stored and organized
Trang 9Record Structures
• Data fields in each record of a database table
• Structure is usually fixed
• Example
Trang 10Database Keys
• Primary Key
– Unique to each record
• Foreign Keys
– Enable referencing of one or more records
– Matches primary key of related table
Trang 11Records Combined Into Report
Trang 12Additional Database Issues
Administration
Database Administrator
Documentation
Includes a variety of descriptions
Structures, Contents, Security Features
Data Dictionary
Metadata
Trang 13Data Dictionary Example
Trang 14Additional Database Issues
• Data Integrity
– Data Integrity controls
– Designed by database developers
• Processing Accuracy and Completeness
– Transaction controls
– Ensures accurate transaction processing
Trang 15Additional Database Issues
• Concurrency
– Concurrency controls
– Prevent multi-user access at same time
• Backup and Security
– Ability to recreate data
– Prevent unauthorized access
– View controls
Trang 19Steps in Developing Databases
Trang 20Steps in Developing Databases
with REA
• Create Entity-Relationship Diagrams
• Identify Attributes of Entities
• Convert E-R Diagrams into Database Tables
Trang 21Identify Events and Entities
Trang 22Entity Examples
Trang 24 Occurrence of one entity
Associated with occurrence of one event of another entity
Trang 25Cardinality Relationships
Trang 26– Rectangles represent entities
– Connecting lines represent relationships
Trang 27E-R Diagram Example
Trang 28Relationship Tables
• Provide greater flexibility
• Need for Relationship Tables
Linking tables with foreign keys
Many-to-many relationships
Trang 29Relationship Tables
Trang 30Schematic of Database Tables
Trang 33• Normalization
– Methodology ensuring attributes are stored in most
appropriate tables
– Design promotes accuracy
– Avoids redundancy of data storage
• Levels
– First normal form
– Second normal form
Trang 34Unnormalized Data
Trang 35First Normal Form
• In First Normal Form (1 NF) when:
– All data fields are singular
– Each attribute has one value
• Problems
– Data redundancy
– Insertion anomaly
– Deletion anomaly
Trang 36First Normal Form Example
Trang 37Second Normal Form
• In Second Normal Form (2 NF) when:
– It is in 1 NF
– All data items depend on primary record key
• Benefits
– More efficient design
– Eliminates data redundancy
Trang 38Second Normal Form Example
Trang 39Third Normal Form
• In Third Normal Form (3 NF) when:
– 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
Trang 40Third Normal Form Example
Trang 41Study Break #5
A database is in third normal form (3 NF) if it is second normal form and:
A All the data attributes in a record are well-defined
B All the data attributes in a record depend on the record key
C The data contains no transitive dependencies
D The data can be stored in two or more separate tables