Introduction to Database Systems
Introduction to Database Systems
Database systems are designed to manage large data set in an organization. The data
management involves both definition and the manipulation of the data which ranges from
simple representation of the data to considerations of structures for the storage of
information. The data management also consider the provision of mechanisms for the
manipulation of information.
Today, Databases are essential to every business. They are used to maintain internal records,
to present data to customers and clients on the World-Wide-Web, and to support many other
commercial processes. Databases are likewise found at the core of many modern
organizations.
The power of databases comes from a body of knowledge and technology that has developed
over several decades and is embodied in specialized software called a database management
system, or DBMS. A DBMS is a powerful tool for creating and managing large amounts of
data efficiently and allowing it to persist over long periods of time, safely. These systems are
among the most complex types of software available.
Thus, for our question: What is a database? In essence a database is nothing more than a
collection of shared information that exists over a long period of time, often many years. In
common dialect, the term database refers to a collection of data that is managed by a DBMS.
Thus the DB course is about:
How to organize data
Supporting multiple users
Efficient and effective data retrieval
Secured and reliable storage of data
Maintaining consistent data
Making information useful for decision making
Data management passes through the different levels of development along with the
development in technology and services. These levels could best be described by categorizing
the levels into three levels of development. Even though there is an advantage and a problem
overcome at each new level, all methods of data handling are in use to some extent. The
major three levels are;
1. Manual Approach
2. Traditional File Based Approach
3. Database Approach
1. Manual Approach
In the manual approach, data storage and retrieval follows the primitive and traditional way
of information handling where cards and paper are used for the purpose. The data storage and
retrieval will be performed using human labour.
1
Files for as many event and objects as the organization has are used to store
information.
Each of the files containing various kinds of information is labelled and stored in one
or more cabinets.
The cabinets could be kept in safe places for security purpose based on the sensitivity
of the information contained in it.
Insertion and retrieval is done by searching first for the right cabinet then for the right
the file then the information.
One could have an indexing system to facilitate access to the data
2
Limitations of the Traditional File Based approach
As business application become more complex demanding more flexible and reliable data
handling methods, the shortcomings of the file based system became evident. These
shortcomings include, but not limited to:
Separation or Isolation of Data: Available information in one application may not be
known. Data Synchronisation is done manually.
Limited data sharing- every application maintains its own data.
Lengthy development and maintenance time
Duplication or redundancy of data (money and time cost and loss of data integrity)
Data dependency on the application- data structure is embedded in the application;
hence, a change in the data structure needs to change the application as well.
Incompatible file formats or data structures (e.g. “C” and COBOL) between different
applications and programs creating inconsistency and difficulty to process jointly.
Fixed query processing which is defined during application development
The limitations for the traditional file based data handling approach arise from two basic
reasons.
1. Definition of the data is embedded in the application program which makes it
difficult to modify the database definition easily.
2. No control over the access and manipulation of the data beyond that imposed by
the application programs.
The most significant problem experienced by the traditional file based approach of data
handling can be formalized by what is called “update anomalies”. We have three types of
update anomalies;
1. Modification Anomalies: a problem experienced when one or more data value is
modified on one application program but not on others containing the same data set.
2. Deletion Anomalies: a problem encountered where one record set is deleted from one
application but remain untouched in other application programs.
3
3. Insertion Anomalies: a problem experienced when ever there is new data item to be
recorded, and the recording is not made in all the applications. And when same data
item is inserted at different applications, there could be errors in encoding which
makes the new data item to be considered as a totally different object.
3. Database Approach
Following a famous paper written by Dr. Edgard Frank Codd in 1970, database systems
changed significantly. Codd proposed that database systems should present the user with a
view of data organized as tables called relations. Behind the scenes, there might be a complex
data structure that allowed rapid response to a variety of queries. But, unlike the user of
earlier database systems, the user of a relational system would not be concerned with the
storage structure. Queries could be expressed in a very high-level language, which greatly
increased the efficiency of database programmers. The database approach emphasizes the
integration and sharing of data throughout the organization.
4
Transaction support can be provided: basic demands of any transaction support
systems are implanted in a full scale DBMS.
Integrity can be maintained: data at different applications will be integrated together
with additional constraints to facilitate validity and consistency of shared data
resource.
Security measures can be enforced: the shared data can be secured by having different
levels of clearance and other data security mechanisms.
Improved decision support: the database will provide information useful for decision
making.
Standards can be enforced: the different ways of using and dealing with data by
different unite of an organization can be balanced and standardized by using database
approach.
Compactness: since it is an electronic data handling method, the data is stored
compactly (no voluminous papers).
Speed: data storage and retrieval is fast as it will be using the modern fast computer
systems.
Less labour: unlike the other data handling methods, data maintenance will not
demand much resource.
Centralized information control: since relevant data in the organization will be stored
at one repository, it can be controlled and managed at the central level.
5
Database Management System (DBMS)
6
DBMS and Components of DBMS Environment
A DBMS is software package used to design, manage, and maintain databases. Each
DBMS should have facilities to define the database, manipulate the content of the database
and control the database. These facilities will help the designer, the user as well as the
database administrator to discharge their responsibility in designing, using and managing
the database. It provides the following facilities:
Data Dictionary:
o Due to the fact that a database is a self describing system, this tool, Data
Dictionary, is used to store and organize information about the data stored in
the database.
7
Data Control Language:
o Database is a shared resource that demands control of data access and usage.
The database administrator should have the facility to control the overall
operation of the system.
o Data Control Languages are commands that will help the Database
Administrator to control the database.
o The commands include grant or revoke privileges to access the database or
particular object within the database and to store or remove database
transactions
The DBMS is software package that helps to design, manage, and use data using the database
approach. Taking a DBMS as a system, one can describe it with respect to it environment or
other systems interacting with the DBMS. The DBMS environment has five components. To
design and use a database, there will be the interaction or integration of Hardware, Software,
Data, Procedure and People.
1. Hardware: are components that one can touch and feel. These components are
comprised of various types of personal computers, mainframe or any server
computers to be used in multi-user system, network infrastructure, and other
peripherals required in the system.
2. Software: are collection of commands and programs used to manipulate the hardware
to perform a function. These include components like the DBMS software,
application programs, operating systems, network software, language software and
other relevant software.
3. Data: since the goal of any database system is to have better control of the data and
making data useful, Data is the most important component to the user of the database.
There are two categories of data in any database system: that is Operational and
Metadata. Operational data is the data actually stored in the system to be used by the
user. Metadata is the data that is used to store information about the database itself.
The structure of the data in the database is called the schema, which is composed of
the Entities, Properties of entities, and relationship between entities and business
constraints.
4. Procedure: this is the rules and regulations on how to design and use a database. It
includes procedures like how to log on to the DBMS, how to use facilities, how to
start and stop DBMS, how to make backup, how to treat hardware and software
failure, how to change the structure of the database.
5. People: this component is composed of the people in the organization that are
responsible or play a role in designing, implementing, managing, administering and
using the resources in the database. This component includes group of people with
high level of knowledge about the database and the design technology to other with
no knowledge of the system except using the data in the database.
As it is one component in most information system development tasks, there are several steps
in designing a database system. Here more emphasis is given to the design phases of the
system development life cycle. The major steps in database design are;
8
2. Analysis: that concentrates more on fact finding about the problem or the opportunity.
Feasibility analysis, requirement determination and structuring, and selection of best
design method are also performed at this phase.
3. Design: in database development more emphasis is given to this phase. The phase is
further divided into three sub-phases.
a. Conceptual Design: concise description of the data, data type, relationship
between data and constraints on the data.
There is no implementation or physical detail consideration.
Used to elicit and structure all information requirements
b. Logical Design: a higher level conceptual abstraction with
selected specific data model to implement the data structure.
It is particular DBMS independent and with no other physical
considerations.
c. Physical Design: physical implementation of the logical design of the
database with respect to internal storage and file structure of the database for
the selected DBMS.
To develop all technology and organizational specification.
4. Implementation: the testing and deployment of the designed database for use.
9
2. Database Administrator (DBA): This is more technically oriented role. DBA
is responsible for the physical realization of the database. It is involved in
physical design, implementation, security and integrity control of the database.
2. Database Designer (DBD)
Identifies the data to be stored and choose the appropriate structures to represent and
store the data.
Should understand the user requirement and should choose how the user views the
database.
Involve on the design phase before the implementation of the database system.
We have two distinctions of database designers, one involving in the logical and
conceptual design and another involving in physical design.
4. End Users
Workers, whose job requires accessing the database frequently for various purposes,
there are different group of users in this category.
1. Naïve Users:
Sizable proportion of users
Unaware of the DBMS
Only access the database based on their access level and demand
Use standard and pre-specified types of queries.
2. Sophisticated Users
Users familiar with the structure of the Database and facilities of the
DBMS.
Have complex requirements
Have higher level queries
Are most of the time engineers, scientists, business analysts, etc
3. Casual Users
Users who access the database occasionally.
10
Need different information from the database each time.
Use sophisticated database queries to satisfy their needs.
Are most of the time middle to high level managers.
These users can be again classified as “Actors on the Scene” and “Workers Behind the
Scene”.
Actors on the Scene:
Data Administrator
Database Administrator
Database Designer
End Users
ANSI-SPARC Architecture
where ANSI-SPARC stands for American National Standards Institute, Standards Planning
And Requirements Committee, is an abstract design standard for a Database Management
System (DBMS), first proposed in 1975.
The purpose and origin of the Three-Level database architecture
All users should be able to access same data. This is important since the database
is having a shared data feature where all the data is stored in one location and all
users will have their own customized way of interacting with the data.
A user's view is unaffected or immune to changes made in other views. Since the
requirement of one user is independent of the other, a change made in one user’s
view should not affect other users.
Users should not need to know physical database storage details. As there are
naïve users of the system, hardware level or physical details should be a black-box
for such users.
DBA should be able to change database storage structures without affecting the
users' views. A change in file organization, access method should not affect the
structure of the data which in turn will have no effect on the users.
Internal structure of database should be unaffected by changes to physical aspects
of storage, such as change of hard disk
DBA should be able to change conceptual structure of database without affecting
all users. In any database system, the DBA will have the privilege to change the
structure of the database, like adding tables, adding and deleting an attribute,
changing the specification of the objects in the database.
All of the above and much more functionalities are possible due to the three level
ANSI-SPARC architecture.
11
Three-level ANSI-SPARC Architecture of a Database
External Level: Users' view of the database. It describes that part of database that is relevant
to a particular user. Different users have their own customized view of the database
independent of other users.
Conceptual Level: Community view of the database. Describes what data is stored in
database and relationships among the data along with the business constraints.
Internal Level: Physical representation of the database on the computer. Describes how the
data is stored in the database.
12
The second level is describing the whole content of the
database where one piece of information will be represented
once.
The third level
13
Data Independence
Logical Data Independence:
Refers to immunity of external schemas to changes in conceptual schema.
Conceptual schema changes e.g. addition/removal of entities should not require
changes to external schema or rewrites of application programs.
The capacity to change the conceptual schema without having to change the
external schemas and their application programs.
Data
Independence and the ANSI-SPARC Three-level Architecture
The distinction between a Data Definition Language (DDL) and a Data Manipulation
Language (DML)
Database Languages
Data Definition Language (DDL)
Allows DBA or user to describe and name entitles, attributes and relationships
required for the application.
Specification notation for defining the database schema
Non-Procedural DML: user specifies what data is required but not how it is to be
retrieved
14
Data Control Language (DCL)
Allows a DBA to define access control and privileges for users.
It is a mechanism for implementing security at a database object level.
Uses the Grant and Revoke SQL Statements
SQL is the most widely used non-procedural query language
Fourth Generation Language (4GL)
Query Languages
Forms Generators
Report Generators
Graphics Generators
Application Generators
A Classification of data models
Data Model
A specific DBMS has its own specific Data Definition Language to define a database
schema, but this type of language is too low level to describe the data requirements of an
organization in a way that is readily understandable by a variety of users.
We need a higher-level language.
Such a higher-level description of the database schema is called data-model.
Data Model: a set of concepts to describe the structure of a database, and certain constraints
that the database should obey.
A data model is a description of the way that data is stored in a database. Data model helps
to understand the relationship between entities and to create the most effective structure to
hold data.
Department
Employee Job
Department Job
Employee
Activity
Time Card
16
Network Model is able to model complex relationships and represents semantics
of add/delete on the relationships.
Can handle most situations for modeling using record types and relationship types.
Language is navigational; uses constructs like FIND, FIND member, FIND
owner, FIND NEXT within set, GET etc. Programmers can do optimal navigation
through the database.
Alternative terminologies
Relation Table File
Tuple Row Record
Attribute Column Field
17