You are on page 1of 6

CHAPTER 9: DATA MANAGEMENT SYSTEM Flat-file Problems Solved

- Data sharing (the absence of ownership) is


the central concept of database approach
OVERVIEW OF THE FLAT-FILE VERSUS
o No data redundancy
DATABASE APPROACH
 Each data element is stored
Data Redundancy only once, thereby
eliminating data redundancy
- The repetition of data across various
and reducing storage costs
systems
o Single update
- Cause three different kinds of issue with
 Because each data element
data management:
exists in only one place, it
1. Data Storage
requires only a single update
2. Data Updating
procedure
3. Currency of Information
 This reduces the time and
Data Storage cost of keeping the database
current
- To meet the private data needs of users,
o Current values
organizations must incur the costs of both
 A change any user makes to
multiple collection and multiple storage
the database yields current
procedures
data value for all other users
- Some commonly used data may be
o Task-data independence
duplicated dozens, hundreds, or even
 Users have access to the full
thousands of times, creating excessive
domain of data available to
storage costs
the firm
Data Updating  As user’s information needs
expand beyond their
- Organizations have a great deal of data
immediate domain, the new
stored on master files and reference files
needs can be more easily
that require periodic updating to reflect
satisfied than under the flat-
operational and economic changes
file approach
Currency of Information

- In contrast to the problem of performing


CONTROLLING ACCESS TO THE DATABASE
multiple updates is the problem of failing to
update the files of all users affected by a - The database approach places all the firm’s
change information eggs in one basket
- If update messages are not properly - It is essential, therefore, to take very good
disseminated, then some users may not care of the basket
record the change and will perform their
duties and make decisions based on
outdated data THE DATABASE MANAGEMENT SYSTEM

Task-Data Dependency - Standing between the user’s programs and


the physical database
- Another problem with the flat-file approach
- Purpose: provide controlled access to the
is the user’s inability to obtain additional
database
information as his or her needs change
- Special software system that is programmed
- The user’s information set is constrained by
to know which data elements each user is
the data that he or she possesses and
authorized to access
controls
- The user’s program sends requests for data
The Database Approach to the DBMS, which validate and authorizes
access to the database in accordance with
the user’s level of activity
- The DBMS will deny requests for data that
the user is unauthorized to access
THREE CONCEPTUAL MODELS o Backup and recovery
 The DBMS periodically
Most common database approaches
makes backup copies of the
1. Hierarchical physical database
2. Network  In the event of a disaster (dis
3. Relational failure, program error, or
malicious act) that renders
ELEMENTS OF THE DATABASE
the dataset unusable, the
ENVIRONMENT
DBMS can recover an earlier
User version that is known to be
correct
- Users access the database in two ways:
o Database usage reporting
o Via user application program that
 This feature captures
system professional prepares
statistics on what data are
 These programs send data
being used, when they are
access request (calls) to the
used, and who uses them
DBMS, which validates the
 The database administrator
requests and retrieves data
(DBA) uses this information
for processing
to help in assigning user
 Under this mode of access,
authorization and in
the presence of the DBMS is
maintaining the database
transparent to the users
o Database access
 Data processing procedures
 The most important feature
(both batch and real-time) for
of a DBMS is to permit
transactions such as sales,
authorized user access to the
cash receipts, and purchases
database
are essentially the same as
they would be in flat-file Data Definition Language
environment
- Programming language used to define the
o Via direct query, which requires no
physical database to he the DBMS
formal user programs
- The definition includes the name and the
 The DBMS has a built-in
relationship of all data elements, records,
query facility that allows
and files that constitute the database
authorized users to process
- DDL defines the database on three levels
data independent of
called views: internal view, conceptual view
professional programmers
(schema), user view (subschema)
 The query facility provides a
o Internal view
friendly environment for
 Presents the physical
integrating and retrieving
arrangement of records in
data to produce ad hoc
the database
management reports
 Lowest level of
 This feature has been an
representation, which is one
attractive incentive for users
step removed from the
to adopt the database
physical database
approach
 Describes the structure of
Database Management System records, the linkages between
them, and the physical
- Provides a controlled environment to assist
arrangement and sequence of
(or prevent) user access to the database and
records in a file
to efficiently manage the data source
 Only one internal view
- Typical features
o Conceptual view (schema)
o Program development
 Represents the database
 The DBMS contains
logically and abstractly,
application development
rather than the way it is
software
physical stored
 Both programmers and end
 This view allows users’
users may employ this
programs to call for data
feature to create applications
without knowing or needing
to access the database
to specify how the data are
arranged or where the data
reside in the physical
database
 Only one conceptual view for
a database
o User view (subschema)
 Defines how a particular user
sees the portion of the
database that he or she is Data Dictionary
authorized to access
- Describes every data element in the
 To the user, the user view is
database
the database
- This enables all users (and programmers) to
 Many distinct user view
share a common view of the data resource
exists
and greatly facilitates the analysis of user
Data Manipulation Language needs

- Proprietary programming language that a Physical Database


particular DBMS uses to retrieve, process,
- Lowest level of the database
and store data
- Consist of magnetic spots on magnetic disks
- Entire user programs may be written in the
- The other levels of the database (user view,
DML pr, alternatively, selected DML
conceptual view, ad internal view) are
commands can be inserted into programs
abstract presentations of the physical level
that are written in universal languages, such
- At the physical level, the database is a
as PL/1, COBOL, and FORTAN
collection of records and files
- Inserting DML commands enables legacy
- Relational databases are based on the
application programs, which were
indexed sequential file structure
originally written for the flat-file
o It facilitates both direct access to
environment or earlier types of DBMSs, to
individual records and batch
be easily converted to work in the current
processing of the entire file
database environment
o Multiple indexes can be used to
- The use of standards language programs
create cross-reference, called an
also provides the organization with a
inverted index list, which allows
degree of independence from the DBMS
even more flexible access to data
vendor

Query Language
THE RELATIONAL DATABASE MODE
- The query capability of the DBMS permits
- The formal model has its foundations in
end users and professional programmers to
relational algebra and set theory, which
access data in the database directly without
provide the theoretical basis for most of the
the need for conventional programs
data manipulation on operations used
- Structured query language
- Accordingly, a system is relational if it:
o Fourth generation, nonprocedural
o Represents data in the form of two-
language with many commands that
dimensional tables such as the
allow users to input, retrieve, and
database table, called Customer
modify data easily
o Supports the relational algebra
Database Administrator functions of restrict, project, and
joint
- This position does not exist in the flat-file
 Restrict
environment
 Extracts specified
- Responsible for managing the database
rows from a specified
resource
table
- Multiple users sharing a common database
 Project
requires organization coordination, rules,
 Extracts specified
and guidelines to protect the integrity of the
attributes (columns)
database
from a table to create
a virtual table
 Join o Corresponds approximately to a
 Builds a new physical record in a flat-file system
table from two tables - Properly designed tables possess the following
consisting of all for characteristics:
concatenated pairs of o The value of at least one attribute in
rows, from each table each occurrence (row) must be
unique. This attribute is the primary
Relational Database Concepts
key, The values of the other
Entity (nonkey) attributes in the row need
not be unique
- Anything about which the organization
o All attribute values in any column
wishes to capture data
must be of the same class
- May be physical (e.g., inventories,
o Each column in a given table must
customers, or employees)
uniquely named. However, different
- Conceptual e.g., such as sales (to a
tables may contain columns with the
customer), accounts receivable, or accounts
same name
payable
o Tables must conform to the rules of
- Systems designers identify entities an
normalization. This means they
prepare a model of them
must be free from structural
- This data model is the blueprint for
dependencies including repeating
ultimately creating the physical database
groups, partial dependencies,
- The graphical presentation used to depict
transitive dependencies
the model is called an entity relationship
(ER) diagram User views

Occurrence - Computer screens for entering or viewing


data, management reports, or source
- Used to describe the number of instances or
documents such as an invoice
records that pertain to a specific entity
- Views may be digital or physical (paper),
Attributes but in all cases, they derive from underlying
database tables
- Data elements that define an entity

Association and Cardinality


ANOMALIES, STRUCTURAL DEPENDENCIES,
- The labeled line connecting two entities in a
AND DATA NORMALIZATION
data model describes the nature of the
association between them Database Anomalies
- Cardinality is the degree of association
- Improperly normalized tables can cause
between two entities
DBMS processing problems that restrict,
o Describes the number of possible
even deny, user’s access to the information
occurrences in one table that are
they need
associated with a single occurrence
- Such tables exhibit negative operational
in a related table
symptoms called anomalies (update
o Four basic forms of cardinality are: zero
anomaly, insertion anomaly, deletion
or one (0,1), one and only one (1,1),
anomaly)
zero or many (0,M), and one or
many (1,M) Update Anomaly
o These are combined to represent
- Results from data redundancy in an
logical associations between entities
unnormalized table

Insertion Anomaly
THE PHYSICAL DATABASE TABLES
- Assume that a new vendor has entered the
- Constructed from the data model with each
marketplace
entity in the model being transformed into a
- The organization does not yet purchase
separate physical table
from the vendor, but may wish to do so in
- Across the top of each table are attributes
the future
forming columns
- In the meantime, the organization wants to
- Intersecting the columns to form the rows of
add the vendor to the database
the table are tuples
- This is not possible, however, because the o The agent prints a copy of the
primary key for the Inventory table is PART purchase order and sends it to the
NUM supplier
- Because the vendor does not supply the o The supplier ships inventory to the
organization with any inventory items, the company. Upon its arrival, the
supplier data cannot be added to the table receiving clerk inspects the
inventory and prepares an online
Deletion Anomaly
receiving report). The computer
- Involves the unintentional deletion of data system automatically updates the
from a table inventory records.
- The presence of the deletion anomaly is less - To pass as valid entities, two conditions
conspicuous, but potentially more serious need to be met:
that the update and insertion anomalies o An entity must consist of two or
- May go undetected, leaving the user more occurrences
unaware of the loss of important data until o An entity must contribute at least
it is too late one attribute that is not provided
- This can result in the unintentional loss of through other entities
critical accounting records and the
Construct a Data Model Showing Entity
destruction of audit trails
Associations
Normalizing Tables
- Determining the associations between
- The database anomalies described above are entities and document them with an ER
symptoms of structural problems within diagram
tables called dependencies
Add Primary Key and Attributes to the Model
- Specifically, these are known as repeating
dependencies - Add Primary Keys: assigning primary keys
to the entities in the model
Linking Normalized Tables
- Add Attributes: every attribute in an entity
- Business Rule 1. Each vendor supplies the should appear directly or indirectly (a
firm with three (or fewer) different items of calculated value) in one or more user views
inventory, but each item is supplied by only
Normalize Data Model and Add Foreign Keys
one vendor.
- Business Rule 2. Each vendor supplies the Construct the Physical Database
firm with any number of inventory items,
Prepare the User Views
but each item is supplied by only one
vendor. This is a true 1:M association in
which the upper limit of the many sides of
DATABASE INA DISTUBTED ENVIRONMENT
the association is unbounded.
- Databases can be centralized, or they can be
distributed
DESIGNING REALTIONAL DATABASES
- Distributed databases
- Database design is a portion of a much o Partitioned
larger systems development process that o Replicated
involves extensive analysis of user needs
Centralized Databases
Six Phases of Database Design (collectively
- Remotes users send request via terminal for
known as view modeling)
data to the central site, which processes the
requests and transmits the data back to the
user
Identify entities
- The central site performs the functions of a
- Key features of a simplified purchasing systems file manager that services the data needs of
o The purchasing agent reviews the the remote users
inventory status report for items that
Database Lockout
need to be reordered
o The agene selects a supplier and - To achieve data currency, simultaneous
prepares an online purchase order access to individual data elements by
multiple sites need to be prevented
- Database lockout, which is a software
control (usually a function of the DBMS)
that prevents multiple simultaneous
accesses to data

Distributed Databases

Partitioned Databases

- Splits the central database into segments or


partitions that are distributed to their
primary users
- Advantages:
o Storing data at local sites increases
users’ control
o Permitting local access to data and
reducing the volume of data that
must be transmitted between sites
improves transaction processing
response time
o Partitioned databases can reduce the
potential for disaster. By having data
located at several; sites, the loss of a
single site cannot terminate al data
processing by the organization

Deadlock Phenomenon

- Deadlock occurs here because there is


mutual exclusion to data, and the
transactions are in a wait state until the
locks are removed.

Deadlock Resolution

1. The resources currently invested in the


transaction. This may be measured by the
number of updates that the transaction has
already performed and that must be
repeated if the transaction is terminated
2. The transaction’s stage of completion. In
general, deadlock resolution software will
avoid terminating transactions that are close
to completion
3. The number of deadlocks associated with
the transaction. Because terminating the
transaction breaks all deadlock
involvement, the software should attempt
to terminate transactions that are part of
more than one deadlock.

You might also like