Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
3
WHAT IS A DATABASE
A database is an organized collection of data. The data are typically organized to model
relevant aspects of reality in a way that supports processes requiring this information.
For example, modeling the availability of rooms in hotels in a way that supports finding a
hotel with vacancies.
Database management systems (DBMSs) are specially designed applications that interact
with the user, other applications, and the database itself to capture and analyze data. A
general-purpose database management system (DBMS) is a software system designed
to allow the definition, creation, querying, update, and administration of databases.
DBMS responsible for maintaining the integrity and security of stored data, and for
recovering information if the system fails.
4
Organizational Structure
Internet
& Intranet
Systems
EDI Trading Maintenance
Personal Computers
Partners Applications
MySQL
MariaDB
PostgreSQL
SQLite
Microsoft SQL Server
Oracle
SAP
Dbase
FoxPro
IBM DB2
LibreOffice
Base and FileMaker Pro
6
FLAT-FILE VERSUS DATABASE ENVIRONMENTS
7
Flat-File Data Management
(Single User View, Exclude Attributes Useful to Others)
User 1 Data
Transactions
Program 1 A,B,C
User 2
Transactions
Program 2
X,B,Y
User 3
Transactions
Program 3
L,B,M
Figure 9-1
8
DATA REDUNDANCY AND FLAT-FILE
PROBLEMS
9
The Database Concept
User 1
Database
Transactions
Program 1
A,
User 2
D B,
Transactions B C,
Program 2 M X,
S Y,
User 3 L,
Transactions M
Program 3
Figure 9-2(b)
10
ADVANTAGES OF THE DATABASE APPROACH
12
ELEMENTS OF THE DATABASE ENVIRONMENT
Figure 9-3
13
FOUR ELEMENTS OF A DATABASE
14
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.
15
DBMS FEATURES
16
DATA DEFINITION LANGUAGE (DDL)
17
OVERVIEW OF DBMS OPERATION (PAGE 150)
Figure 9-4
18
DATA MANIPULATION LANGUAGE (DML)
DML is the proprietary programming language that a particular DBMS uses to
retrieve, process, and store 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
19
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
20
FUNCTIONS OF THE DBA
21
PHYSICAL DATABASE
Lowest level of database and the only level that exists in physical form
Logical collection of records and files that constitute the firm’s data source.
Table 4.2 contains file processing operations that data structures must support.
DATA STRUCTURE
DATA STRUCTURE COMPONENTS
1. Data Organization – physical arrangement of files
2. Data Access Methods – technique to locate records
***SIX CRITERIA INFLUENCING THE SELECTION OF DATA STRUCTURE
22
DATABASE TERMINOLOGY
Associations
One to One Associations
Database
One to Many Associations
Many to Many Assocations
23
DATABASE CONCEPTUAL MODELS
24
HIERARCHICAL MODEL
25
NETWORK MODEL
ANSI thru CODASYL
Most popular model of network is IDMS
Navigational thru multiple linkages
A child can have multiple parents
26
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.
Implicit linkages, rows are dependent on the primary key and independent of the other
attributes
Linkages are established through logical operations of the DMBS rather than explicit
addresses that are structured into the database.
Figure 4.14
ATTRIBUTES
TUPLES
27
The Relational Algebra Functions
Restrict, Project, and Join
Figure 9-9
28
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.
29
DISTRIBUTED DATA PROCESSING (DDP)
30
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.
31
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
32
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
33
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.
34
DISTRIBUTED DATABASES: PARTITIONED DATABASE
APPROACH (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.
35
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.
36
THE DEADLOCK CONDITION
Mutual exclusion to data resource and the transactions are in wait until the locks are
removed.
DEADLOCK RESOLUTION - terminating on or more transactions to complete
processing of the other transactions in the deadlock.
Figure 9-26
37
DISTRIBUTED DATABASES:
REPLICATION
Effective when there is high degree of sharing
but no primary user
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.
38
CONCURRENCY CONTROL: CONCURRENCY
PROBLEMS AND CONTROL ISSUES
39
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?
40
DATABASE MANAGEMENT CONTROLS
42
COMPUTER RESOURCE
User 1 works in A/R
AUTHORITY TABLE Dept. Can Read, Add,
& Delete data.
Read data
User 1 Change No Access Use No Access
Add
Delete
Read only Read code
User 2 No Access Use Modify
Delete
47
BACKUP CONTROLS