Ais Chapter 9
Ais Chapter 9
DBMS model accomplishes these objectives USER VIEW (SUBSCHEMA). - The user view defines
differently, but some typical features include: how a particular user sees the portion of the database
that he or she is authorized to access.
1. Program development - The DBMS contains
application development software. Both DBMS OPERATION.
programmers and end users may employ this
1. A user program sends a request (call) for data to the
feature to create applications to access the
DBMS.
database.
2. Backup and recovery - During processing, the 2. The DBMS analyzes the request by matching the called
DBMS periodically makes backup copies of the data elements against the user view and the conceptual
view. If the data request matches, it is authorized, and
physical database.
processing proceeds to Step 3. If it does not match the
3. Database usage reporting - This feature
views, access is denied.
captures statistics on what data are being
used, when they are used, and who uses them. 3. The DBMS determines the data structure parameters
4. Database access - The most important feature from the internal view and passes them to the operating
system, which performs the actual data retrieval. Data
of a DBMS is to permit authorized user access
structure parameters - describe the organization and
to the database
access method (an operating system utility program) for
Data definition language (DDL) - is a programming retrieving the requested data.
language used to define the physical database to the 4. Using the appropriate access method, the operating
DBMS. system interacts with the disk storage device to retrieve
The definition includes the names and the relationship the data from the physical database.
of all data elements, records, and files that constitute 5. The operating system then stores the data in a main
the database. memory buffer area managed by the DBMS.
The DDL defines the database on three levels called 6. The DBMS transfers the data to the user’s work location
views: in main memory. At this point, the user’s program is free to
access and manipulate the data.
1. Internal view
7. When processing is complete, Steps 4, 5, and 6 are
2. Conceptual view (schema)
reversed to restore the processed data to the database.
3. User view (subschema)
Data manipulation language (DML) - is the proprietary
programming language, which a particular DBMS uses to
Data dictionary - describes every data element in the
retrieve, process, and store data.
database. This enables all users (and programmers) to
Query - capability of the DBMS permits end users and share a common view of the data resource and greatly
professional programmers to access data in the database facilitates the analysis of user needs.
directly without the need for conventional programs.
THE PHYSICAL DATABASE - the lowest level of the
IBM’s indexed sequential file - (SQL, pronounced sequel) database. The physical database consists of magnetic spots
has emerged as the standard query language for both on magnetic disks. The other levels of the database (e.g.,
mainframe and microcomputer DBMSs. the user view, conceptual view, and internal view) are
abstract representations of the physical level.
SQL - is a fourth-generation, nonprocedural language with
many commands that allow users to input, retrieve, and Indexed sequential file - facilitates both direct access to
modify data easily. individual records and batch processing of the entire file.
- far less training in computer concepts and fewer Inverted list - allows even more flexible access to data.
programming skills than many other programming
Two indexes
languages
- is an efficient data processing tool - One contains the employee number (primary key)
for uniquely locating records in the file.
SELECT - command is a powerful tool for retrieving data.
- The second index contains record addresses
Database administrator (DBA) –The DBA is responsible for arranged by year-to-date earnings.
managing the database resource. Having multiple users
E. F. Codd - proposed the principles of the relational model
share a common database requires organization,
in the late 1960s.
coordination, rules, and guidelines to protect the integrity
of the database. Relational model - The formal model has its foundations in
relational algebra and set theory, which provide the
- The duties of the DBA fall into the following areas:
theoretical basis for most of the data manipulation
database planning, database design, database
operations used.
implementation, database operation and
maintenance, and database change and growth. From a purist’s point of view, a fully relational system is
one that conforms to 12 stringent rules that Codd
outlined.
Attributes - are the data elements that define an entity. Database Anomalies - The answer to the questions asked
in previous section is that improperly normalized tables
Association - describes the nature of the functional
can cause DBMS processing problems that restrict, or even
connection between two entities in a relation.
deny, users’ access to the information they need. Such
Cardinality - the degree of association between two tables exhibit negative operational symptoms called
entities anomalies.
The database anomalies described earlier in the text 2. Normalize the data model and add primary keys.
are symptoms of structural problems within tables
3. Determine cardinalities and add foreign keys.
called dependencies. Specifically, these are known as:
4. Construct the physical database.
1. Repeating groups
2. Partial dependencies 5. Prepare the physical user views.
3. Transitive dependencies
View modeling - begins by identifying the relevant
The normalization process involves identifying and views of the business function in question. This
removing structural dependencies from the table(s) involves user interviews, and other techniques, to
being modeled such that the resulting 3NF table determine what users do and what information they
designs will meet two conditions: need to support their tasks.
1. All nonkey (data) attributes in the table are To demonstrate view identification, we will analyze the
dependent on (defined by) the primary key. following key features of a simplified purchasing
function:
2. All nonkey attributes are independent of the other
nonkey attributes. 1. The purchasing agent reviews the inventory status
report for items that need to be reordered.
3NF table - is one in which the primary key of a table
wholly and uniquely defines each attribute in the table. 2. The agent selects a supplier and prepares a digital
purchase order from his terminal.
PART NUM - Primary key for the Inventory table
3. The agent prints a copy of the purchase order and
Repeating group data - occur when multiple values for
sends it to the supplier.
a particular attribute exist in a specific tuple.
4. The supplier ships the inventory to the company.
Relational database theory - prohibits the
Upon its arrival, the receiving clerk inspects the
construction of a table in which a single tuple (a row in
inventory and prepares the digital receiving report. The
the table) represents multiple values for an attribute (a
computer system automatically updates the inventory
column in the table).
records.
Composite key - primary key of the Line-Item table
This description identifies three views:
Composite key comprises two attributes: INVOICE
(1) Inventory Status Report
NUM and PROD NUM.
(2) Purchase Order, and
Partial dependency - occurs when one or more nonkey
attributes are dependent on (defined by) only part of (3) Receiving Report.
the primary key, rather than the whole key. This can
1. Repeating Group Data in Status Report Entity - The
occur only in tables that have composite (two or more
nonkey attributes of Supplier Number, Supplier Name,
attributes) primary keys.
Supplier Address, and Supplier Tel Number are
INVOICE NUM - uniquely and wholly defines the repeating group data in the Status Report.
economic event that the Order Date, Shpd Date, and
Shpd Via attributes represent.
Repeating Group Data in Purchase Order Entity - The PART NUMBER - portion of the key is used to access the
attributes of Part Number, Description, Order Quantity, Inventory table to facilitate updating the Quantity on Hand
and Unit Cost are repeating group data. field from the Quantity Received field of the Rec Rept Item-
Detail table.
Partial Dependency in PO Item Detail Entity - An
- Element of the key is a link to the Inventory table where
analysis of the PO Item Detail entity reveals that its
Description and Unit Cost data are stored.
composite primary key uniquely defines only Order
Quantity. PO NUMBER - component of the composite key provides a link
to the Purchase Order table.
Transitive Dependency in Purchase Order Entity - The
attributes of Supplier Name, Supplier Address, and SQL commands will be saved in a user program called a query.
Supplier Tel Number are transitive dependencies, Commercial systems - are designed to comply with proven
which are defined by Supplier Number. industry best practices and to satisfy the most common needs of
different client organization.
Repeating Group Data in Receiving Report Entity - The
attributes Part Number, Quantity Received, and Distributed databases fall into two categories: partitioned and
Condition Code are repeating groups in the Receiving replicated.
Report entity and were removed to a new entity called Centralized database approach - remote users send requests via
Rec Report Item Detail. terminals for data to the central site, which processes the
requests and transmits the data back to the user. The central site
Transitive Dependency in Receiving Report Entity -
performs the functions of a file manager that services the data
The attributes Supplier Name, Supplier Address, and needs of the remote users.
Supplier Tel Number are defined by Supplier Number
and not defined by the primary key PO Number. Data currency - (i.e., the firm’s data files reflect accurately
the effects of its transactions).
View Integration - Combining the data needs of all
users into a single entity-wide schema. Database lockout - which is a software control (usually a
function of the DBMS) that prevents multiple simultaneous
This involves the consolidation of the attributes from accesses to data.
all user views into a common set of normalized entities
that meet the following conditions: Distributed databases - can be distributed using either the
partitioned or replicated technique.
1. An entity must consist of two or more occurrences.
Partitioned database - approach splits the central
2. No two entities may have the same primary key. The
database into segments or partitions that are distributed to
exceptions to this are entities with composite keys that
their primary users. The advantages of this approach are:
comprise the primary keys of other entities.
3. No nonkey attribute may be associated with more than • Storing data at local sites increases users’ control.
one entity. For example, if Customer Address is an attribute
• Permitting local access to data and reducing the volume
of the Customer entity, it cannot also be an attribute of
of data that must be transmitted between sites improve
another entity. All views that use Customer Address will
transaction processing response time.
retrieve it from the Customer entity.
SELECT command - identifies all of the attributes to be • Partitioned databases can reduce the potential for
contained in the view. disaster. By having data located at several sites, the loss of
a single site cannot terminate all data processing by the
FROM command - identifies the tables used in creating the
organization.
view.
Deadlock - occurs here because there is mutual exclusion
REC REPT NUMBER - portion of the key provides the link to
to data, and the transactions are in a wait state until the
the Receiving Report table that contains general data about
the receiving event locks are removed. A deadlock is a permanent condition
that must be resolved by special software that analyzes
each deadlock condition to determine the best solution.
DEADLOCK RESOLUTION.