Database System

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 20

Database System Concepts

Before the advent of Database systems

One way to keep the information on a computer is to store it in the permanent files. The system
has a number of application programs, each of them is defined to manipulate the data files. These
application programs have been written on request of the users in the organization. New
application will be added to the system as the need arises. The system just described is called the
file-based system.

Consider a traditional banking system which using the file-based system in managing the
organization’s data in the picture below. As we can see, there are different departments in the
Bank, each of them has their own applications which manage and manipulate different data files.
For Banking system, the programs can be the one to debit or credit an account, , find the balance
of an account, add a new mortgage loan or generate monthly statements etc.

File-based approach for banking system

Keeping organizational information in this approach has a number of disadvantages, including :

 Data Redundancy: Since files and applications are created by different programmer of
various departments over long period of time, it might lead to several problems:
o Inconsistency in data format
o The same information may be kept in several different place (files).
o Data inconsistency which means various copies of the same data are conflicting ;
waste storage space and duplication of effort
 Data Isolation
o It is difficult for new application to retrieve the appropriate data which might be
stored in various files.

 Integrity problems
o Data values must satisfy certain consistency constraints which are specified in the
application programs.
o It is difficult to add change the programs to enforce new constraint
 Security problems
o There are constraint regarding accessing privileges
o Application is added to the system in the ad-hoc manner so it is difficult to
enforce those constraints
 Concurrent – access irregularities
o Data may be accessed by many applications that have not been coordinated
previously so it is not easy to provide a strategy to support multiple users to
update data simultaneously

These difficulties have prompted the development of a new approach in managing large amount
of organizational information – database approach. In the following section, we shall see the
concepts that have been introduced to get over the problems mentioned.

Database Approach

Database and database technology play an important role in most of social areas where computer
are used, including business, education, medicine etc. To understand the fundamental of database
system, we start from introducing the basic concepts in this area.

Fundamental Concepts

Database is a shared collection of related data which will be used to support the
activities of particular organization. Database can be viewed as a repository of data
that is defined once and then is accessed by various users. A database has the
following properties:

 It is a representation of some aspect of the real world; or perhaps, a collection of data


elements (facts) representing real-world information.
 Database is logical coherent and internally consistent.
 Database is designed, built, and populated with data for a specific purpose.

Database Management System (DBMS) is a collection of programs that enable users to


create, maintain database and control all the access to the database. The primary goal of
the DBMS is to provide an environment that is both convenient and efficient for user to
retrieve and store information.

Application program accesses the data stored in the database by sending requests to the DBMS.
The components of a database system

With the database approach, we can have the traditional banking system as shown in the
following picture.
Database approach for banking system

Characteristics of Database approach

There are a number of characteristics that distinguish the database approach with the file-based
approach. In this section, we describe in detail some of those important characteristics.

 Self-Describing Nature of a Database System : Database System contains not only the
database itself but also the descriptions of data structure and constraints (meta-data).
These information is used by the DBMS software or database users if needed. This
seperation makes database system totally different from traditional file-based sytem in
which data definition is a part of application programs
 Insulation between Program and Data : In the filed base sytem, the structure of the data
files is defined in the application programs so if user want to change the structure of a
file, all the programs access to that files might need to be changed. On the other hand, in
database approach, data structure is stored in the system catalog not in the programs so
such changes might not occurs.
 Support multiple views of data: A view is a subset of the database which is defined and
dedicated for particular users of the system. Multiple users in the system might have
different views of the system. Each view might contains only the interested data of an
user or a group of user.
 Sharing of data and Multiuser system: A multiuser database system must allow multiple
users access the database at the same time. As the result, the multiuser DBMS must have
concurrency control strategies to ensure that several user try to access the same data item
at a time do so in the manner so that the data always be correct.

Benefits of Database Approach

 To control Data Redundancy


o In the Database approach, ideally each data item is stored in only one place in the
database
o However, in some case redundancy is still exists to improving system
performance, but such redundancy is controlled and kept to minimum
 Data Sharing
o The integration of the whole data in an organization leads to the ability to produce
more information from a given amount of data

 Enforcing Integrity Constraints


o DBMSs should provide capabilities to define and enforce certain constraints such
as data type, data uniqueness.
 Restricting Unauthorised Access
o Not all users of the system have the same accessing privileges.
o DBMSs should provide a security subsystem to create and control the user
accounts.

 Data Independence
o The system data descriptions are separated from the application programs.
o Changes to the data structure is handled by the DBMS and not embedded in the
program.
 Transaction Processing
o The DBMS must include concurrency control subsystem to ensure that several
users trying to update the same data do so in a controlled manner so that the result
of the updates is correct.

 Providing multiple views of data


o A view may be a subset of the database. Various users may have different views
of the database itself.
o Users may not need to be aware of how and where the data they refer to is stored
 Providing backup and recovery facilities
o If the computer system fails in the middle of a complex update program, the
recovery subsystem is responsible for making sure that the database is restored to
the stage it was in before the program started executing.

Data Models, Diagrams and Instances

Data Model is a collection of concepts that can be used to describe the structure of
database. Structure of database means data types, relationships and restrictions. In
addition, most data model include a set of basic operations for specifying retrievals
and modifications on the database. Data Model provides a means to achieve Data
Abstraction. Data Abstraction is referring to the hiding of certain details of how the
data are stored and maintained. With several levels of abstraction, the user’s view
of the database is simplified and this leads to the improved understanding of data.

There are three levels of abstractions:

 View level: The highest level of abstraction describes only part of the entire database.
Many users will not be concerned with the large database. Instead, they need to access
only a part of it so that view level abstraction is defined. There are many views for the
same database.
 Logical level: This level describes what data are stored in the whole database.
 Physical level: The lowest level of abstraction describes how the data are actually stored.

Categories of Data Model

 High-level Conceptual Data models: Provide concepts that are close to the way people
perceive data to present the data. Typical example of this type is entity – relationship
model which use main concepts like entities, attributes, relationships. An entity
represents real-world object such as an employee, a project. An entity has some attributes
which represents properties of entity such as employee’s name, address, birthdate. A
relationship represents association among entities for example a works on relationships
between employee and project.
Record-based Logical Data models: Provide concepts that can be understood by the user but not too far from the way data is
stored in the computer. Three well-known data models of this type are relational data model, network data model and hierarchical
data model.

 The Relational model represents data as relations or tables.

Example of a relational schema for the SUPERMARKET database

MANAGERS
EMPS (ENAME, SALARY)
(ENAME)

SUPPLIERS (SNAME,
DEPTS (DNAME, DEPT#)
SADDR)

ITEMS (INAME, ITEM#) ORDERS (O#, DATE)

MANAGES (ENAME,
WORKS_IN (ENAME, DNAME)
DNAME)

PLACED_BY (O#,
CARRIES (INAME, DNAME)
CNAME)

CUSTOMERS(CNAME,CADDR,BALANCE)SUPPLIES
(SNAME, INAME, PRICES)INCLUDES (O#, INAME,
QUANTITY)

 The Network model represents data as record types and also represents a limited type of
one to many relationship, called set type.

The figure below shows a schema in network model notation


 The Hierarchical model represent data as hierarchical tree structures. Each hierarchy
represents a number of related records. Here is the schema in hierarchical model notation.

 Physical Data models: Provide concepts that describe how data is actually stored in the
computer.

Database Instances and Schemas

The description of the database which is designed in the early stage and is not expected to change frequently is called the
database schema. Database system have severals schemas

Since information can be inserted to or deleted from database at anytime, database changes over time. At a particular moment, the
collection of information stored in the database is called an instance of the database.

ANSI/SPARC Architecture (Three –level Architecture)

Three – level architecture for database system is proposed to archive the characteristics of the
database approach. The goal of this architecture is separate the applications and the physical
database so the actual details of how data is organized are hided from the users.
Three- level Architecture

As we can see from above picture, there are three levels of schemas in the database architecture

External level:

 In this highest level, there exists a number of views which of is defined a part of the
actual database.
 Each view is provided for a user or a group of users so that it helps in simplified the
interaction between the user and system.

Conceptual level: Conceptual Schema in this level describes the logical structure of the whole
database.

 The entire database is described using simple logical concepts such as objects, their
properties or relationships. Thus the complexity of the implementation detail of the data
with be hided from the users.

Internal level: Internal Schema in this level describes how the data are actually stored, how to
access the data.
Data Independence

Data Independence is the ability to modify the schema in one level without affecting the schema
in the higher level.

There are two levels of data independence:

 Logical data independence is the ability to make change in the conceptual schema
without causing a modify in the user views or application program.

 Physical data independence is the ability to make change in the internal schema without
causing a modify in the conceptual schema or application program.

Physical data independence seem to be easier to achieve since the way the data is organized in
the memory affect only the performance of the system. Meanwhile, the application program
depends much on the logical structure of the data that they are access.

Database Language

Data Definition Language (DDL): This is used to define the conceptual and internal schemas for
a database system.

 It is not procedural language, rather a language for describing the types of entities and
relationships among them in terms of a particular data model.

 Data Manipulation Language (DML): This is used to manipulate the database, which
typically include retrieval, insertion, deletion, and modification of the data.

Database Users

End users

These are People whose jobs require access to database for querying, updating and generating
report.

End users might be one of the following

 Naïve users who use the existing application programs to perform their daily tasks
 Sophisticated users are who use their own way to access to the database. This means they
do not use the application program provided in the system. Instead, they might define
their own application or describe their need directly in query languages.
 Specialized users maintain the personal database by using ready –make program
packages that provide easy-to-use menu.
Application Programmer

People implement specific application program to access to the stored data. This kind of user,
need to familiarize with the DBMS to accomplish their task.

Database Administrators

A person or a group of people in the organization who is responsible for authorizing the access to
the database, monitoring its use and managing all the resource to support the use of the whole
database system

Classification of Database Systems

The database management systems can be classified based on several criteria.

 Based on data model: The most popular data model in today commercial DBMSs is
relational data model. Almost wellknown DBMSs like Oracle, MS SQL Server, DB2,
MySQL are support this model. Other traditional models can be named hierarchical data
model , network data model. In the recent year, we are getting familiar with object-
oriented data model but this model has not had widespread use. Some examples of
Object-oriented DBMSs are O2, ObjectStore or Jasmine.
 Based on number users we can have single user database system which support one user
at a time or multiuser syste,s which support multiple users concurrently
 Based on the ways database is distributed we have centralized or distributed database
system
o Centralized database system : Data in this kind of system is stored at a single site.

Centralized Database System

 Distributed database sytem: Actual database and DBMS software are distributed in
various sites connected by a computer network.
 Homogeneous distributed Database Systems
o Use the same DBMS software at multiple sites
o Data exchange between various sites can be handle easily
 Heterogeneous distributed Database Systems
o Different sites might use differents DBMS softwares
o There is a software to support data exchange between sites

Distributed Database System

Components of a Database Management


System
Organizations produce and gather data as they operate. Contained in a database, data is typically
organized to model relevant aspects of reality in a way that supports processes requiring this
information. Knowing how this can be managed effectively is vital to any organization.
What is a Database Management System (or DBMS)?

Organizations employ Database Management Systems (or DBMS) to help them effectively manage
their data and derive relevant information out of it. A DBMS is a technology tool that directly supports
data management. It is a package designed to define, manipulate, and manage data in a database.
Some general functions of a DBMS:
 Designed to allow the definition, creation, querying, update, and administration of databases
 Define rules to validate the data and relieve users of framing programs for data maintenance
 Convert an existing database, or archive a large and growing one
 Run business applications, which perform the tasks of managing business processes, interacting
with end-users and other applications, to capture and analyze data
Some well-known DBMSs are Microsoft SQL Server, Microsoft Access, Oracle, SAP, and others.
Components of DBMS
DBMS have several components, each performing very significant tasks in the database
management system environment. Below is a list of components within the database and its
environment.

Software
This is the set of programs used to control and manage the overall database. This includes the
DBMS software itself, the Operating System, the network software being used to share the data
among users, and the application programs used to access data in the DBMS.

Hardware
Consists of a set of physical electronic devices such as computers, I/O devices, storage devices,
etc., this provides the interface between computers and the real world systems.

Data
DBMS exists to collect, store, process and access data, the most important component. The
database contains both the actual or operational data and the metadata.
Procedures
These are the instructions and rules that assist on how to use the DBMS, and in designing and
running the database, using documented procedures, to guide the users that operate and manage it.

Database Access Language


This is used to access the data to and from the database, to enter new data, update existing data, or
retrieve required data from databases. The user writes a set of appropriate commands in a database
access language, submits these to the DBMS, which then processes the data and generates and
displays a set of results into a user readable form.

Query Processor
This transforms the user queries into a series of low-level instructions. This reads the online user’s
query and translates it into an efficient series of operations in a form capable of being sent to the run
time data manager for execution.

Run Time Database Manager


Sometimes referred to as the database control system, this is the central software component of the
DBMS that interfaces with user-submitted application programs and queries, and handles database
access at run time. Its function is to convert operations in user’s queries. It provides control to
maintain the consistency, integrity and security of the data.

Data Manager
Also called the cache manger, this is responsible for handling of data in the database, providing a
recovery to the system that allows it to recover the data after a failure.

Database Engine
The core service for storing, processing, and securing data, this provides controlled access and
rapid transaction processing to address the requirements of the most demanding data consuming
applications. It is often used to create relational databases for online transaction processing or online
analytical processing data.

Data Dictionary
This is a reserved space within a database used to store information about the database itself. A
data dictionary is a set of read-only table and views, containing the different information about the
data used in the enterprise to ensure that database representation of the data follow one standard
as defined in the dictionary.

Report Writer
Also referred to as the report generator, it is a program that extracts information from one or more
files and presents the information in a specified format. Most report writers allow the user to select
records that meet certain conditions and to display selected fields in rows and columns, or also
format the data into different charts.

Characteristics and Benefits of a Database


There are a number of characteristics that distinguish the database approach from the
file-based system or approach. This chapter describes the benefits (and features) of the
database system.

Self-describing nature of a database system


A database system is referred to as self-describing because it not only contains the
database itself, but also metadata which defines and describes the data and
relationships between tables in the database. This information is used by the DBMS
software or database users if needed. This separation of data and information about
the data makes a database system totally different from the traditional file-based
system in which the data definition is part of the application programs.

Insulation between program and data


In the file-based system, the structure of the data files is defined in the application
programs so if a user wants to change the structure of a file, all the programs that
access that file might need to be changed as well.

On the other hand, in the database approach, the data structure is stored in the system
catalogue and not in the programs. Therefore, one change is all that is needed to
change the structure of a file. This insulation between the programs and data is also
called program-data independence.
Support for multiple views of data
A database supports multiple views of data. A view is a subset of the database, which
is defined and dedicated for particular users of the system. Multiple users in the
system might have different views of the system. Each view might contain only the
data of interest to a user or group of users.

Sharing of data and multiuser system


Current database systems are designed for multiple users. That is, they allow many
users to access the same database at the same time. This access is achieved through
features called concurrency control strategies. These strategies ensure that the data
accessed are always correct and that data integrity is maintained.

The design of modern multiuser database systems is a great improvement from those
in the past which restricted usage to one person at a time.

Control of data redundancy

In the database approach, ideally, each data item is stored in only one place in the
database. In some cases, data redundancy still exists to improve system performance,
but such redundancy is controlled by application programming and kept to minimum
by introducing as little redundancy as possible when designing the database.

Data sharing
The integration of all the data, for an organization, within a database system has many
advantages. First, it allows for data sharing among employees and others who have
access to the system. Second, it gives users the ability to generate more information
from a given amount of data than would be possible without the integration.

Enforcement of integrity constraints


Database management systems must provide the ability to define and enforce certain
constraints to ensure that users enter valid information and maintain data
integrity. A database constraint is a restriction or rule that dictates what can be
entered or edited in a table such as a postal code using a certain format or adding a
valid city in the City field.

There are many types of database constraints. Data type, for example, determines the
sort of data permitted in a field, for example numbers only. Data uniqueness such as
the primary key ensures that no duplicates are entered. Constraints can be simple
(field based) or complex (programming).

Restriction of unauthorized access


Not all users of a database system will have the same accessing privileges. For
example, one user might have read-only access (i.e., the ability to read a file but not
make changes), while another might have read and write privileges, which is the
ability to both read and modify a file. For this reason, a database management system
should provide a security subsystem to create and control different types of user
accounts and restrict unauthorized access.

Data independence
Another advantage of a database management system is how it allows for data
independence. In other words, the system data descriptions or data describing data
(metadata) are separated from the application programs. This is possible because
changes to the data structure are handled by the database management system and are
not embedded in the program itself.

Transaction processing
A database management system must include concurrency control subsystems. This
feature ensures that data remains consistent and valid during transaction processing
even if several users update the same information.

Provision for multiple views of data


By its very nature, a DBMS permits many users to have access to its database either
individually or simultaneously. It is not important for users to be aware of how and
where the data they access is stored
Backup and recovery facilities
Backup and recovery are methods that allow you to protect your data from loss. The
database system provides a separate process, from that of a network backup, for
backing up and recovering data. If a hard drive fails and the database stored on the
hard drive is not accessible, the only way to recover the database is from a backup.
If a computer system fails in the middle of a complex update process, the recovery
subsystem is responsible for making sure that the database is restored to its original
state. These are two more benefits of a database management system.

Key Terms
concurrency control strategies: features of a database that allow several users access
to the same data item at the same time
data type: determines the sort of data permitted in a field, for example numbers only
data uniqueness: ensures that no duplicates are entered
database constraint: a restriction that determines what is allowed to be entered or
edited in a table
metadata: defines and describes the data and relationships between tables in the
database
read and write privileges: the ability to both read and modify a file
read-only access: the ability to read a file but not make changes
self-describing: a database system is referred to as self-describing because it not only
contains the database itself, but also metadata which defines and describes the data
and relationships between tables in the database

Functions of DBMS
DBMS performs several important functions that guarantee the integrity and
consistency of the data in the database. The most important functions of
Database Management System are

Data Dictionary Management,


Data Storage Management,
Data Transformation and Presentation,
Security Management,
Multi user Access Control,
Backup and Recovery Management,
Data Integrity Management,
Database Access Languages and Application Programming Interfaces and
Database Communication interfaces.
1. Data Dictionary Management
Data Dictionary Management is the one of the most important function of
database management system.
DBMS stores definitions of the data elements and their relationships
(metadata) in a data dictionary.
So, all programs that access the data in the database work through the
DBMS.
The DBMS uses the data dictionary to look up the required data component
structures and relationships which relieves you from coding such complex
relationships in each program.
Additionally, any changes made in a database structure are automatically
recorded in the data dictionary, thereby freeing you from having to modify
all of the programs that access the changed structure.
In other words, the DBMS system provides data abstraction, and it removes
structural and data dependence from the system.

2. Data Storage Management


One of the DBMS functionality is creating and managing the complex
structures required for data storage, thus relieving you from the difficult task
of defining and programming the physical data characteristics.
A modern DBMS system provides storage not only for the data, but also for
related data entry forms or screen definitions, report definitions, data
validation rules, procedural code, structures to handle video and picture
formats, and so on.
Data storage management is also important for database performance
tuning. Performance tuning relates to the activities that make the database
perform more efficiently in terms of storage and access speed. So, the data
storage management is another important function of Database
Management System.

3. Data transformation and presentation


The DBMS transforms entered data in to required data structures. The
DBMS relieves you of the chore of making a distinction between the logical
data format and the physical data format. That is, the DBMS formats the
physically retrieved data to make it conform to the user’s logical
expectations.
For example, imagine an enterprise database used by a multinational
company. An end user in England would expect to enter data such as July
11, 2009, as “11/07/2009.” In contrast, the same date would be entered in
the United States as “07/11/2009.” Regardless of the data presentation
format, the DBMS system must manage the date in the proper format for
each country.
4. Security Management
Security Management is another important function of Database
Management System (DBMS). The DBMS creates a security system that
enforces user security and data privacy. Security rules determine which
users can access the database, which data items each user can access, and
which data operations (read, add, delete, or modify) the user can perform.
This is especially important in multiuser database systems.
5. Multi User Access Control
Multiuser access control is another important DBMS Function. To provide
data integrity and data consistency, the DBMS uses sophisticated algorithms
to ensure that multiple users can access the database concurrently without
compromising the integrity of the database.

6. Backup and Recovery Management

The DBMS provides backup and data recovery to ensure data safety and
integrity.
Current DBMS systems provide special utilities that allow the DBA to perform
routine and special backup and restore procedures. Recovery management
deals with the recovery of the database after a failure, such as a bad sector
in the disk or a power failure. Such capability is critical to preserving the
database’s integrity.

7. Data Integrity Management


Data integrity management is another important DBMS function.
The DBMS promotes and enforces integrity rules, thus minimizing data
redundancy and maximizing data consistency.
The data relationships stored in the data dictionary are used to enforce data
integrity. Ensuring data integrity is important DBMS functionality in
transaction-oriented database systems.
8. Database Access Languages and Application Programming
Interfaces

The DBMS provides data access through a query language. A query language
is a non-procedural language—one that lets the user specify what must be
done without having to specify how it is to be done.
Structured Query Language (SQL) is the defacto query language and data
access standard supported by the majority of DBMS vendors.

9. Database Communication Interfaces

Current-generation DBMS's accept end-user requests via multiple, different


network environments. For example, the DBMS might provide access to the
database via the Internet through the use of Web browsers such as Mozilla
Firefox or Microsoft Internet Explorer. In this environment, communications
can be accomplished in several ways:

- End users can generate answers to queries by filling in screen forms


through their preferred Web browser.

- The DBMS can automatically publish predefined reports on a Website.

- The DBMS can connect to third-party systems to distribute information via


e-mail or other productivity applications.

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy