Professional Documents
Culture Documents
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
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
Deadlock Phenomenon
Deadlock Resolution