Chapter-One
Introduction to Database
Systems
1
Outline
1.1 Overview
1.2 Needs of databases
1.3 File-based approach Vs. Database approach
1.4 Limitations of file-based systems
1.5 Advantages and disadvantages of database
systems
1.6 Roles of people in database environment
1.7 The ANSI-SPARC database architecture
2
1.1 Overview
Database
A shared collection of logically related data, and
a description of this data, designed to meet the
information needs of an organization.
Note the uses of the phrases:-
• Shared collection
• Logically related
• Description of data
3
Database System
It is a system which has the following
components
Database,
Database Management System,
• DBMS is a software that enables users to define,
create, maintain, and control access to the
database
Hardware.
People having roles to play in the database
environment, and
Some application programs
4
Database System: Overview
Assuming AAUSC uses a Database
System to handle student records how do
Instructors enter grades?
Students register for courses?
Students get information on their academic
performance?
Queries are processed?
5
1.2 Needs of databases
Database and Database Systems have become an
essential component of everyday life in modern society
It is fair to say that databases play a critical role in
almost all areas where computers are used
Some examples
Depositing or withdrawing money from a bank
Making airline reservation
Accessing a computerized library catalog to search for books
Purchasing an item from a supermarket
Booking a holiday at the travel agent
Purchasing using your credit card
Using the Internet
All these may involve accessing databases
6
Database Applications:
Banking: all transactions
Airlines: reservations, schedules
Universities: registration, grades
Sales: customers, products, purchases
Manufacturing: production, inventory,
orders, supply chain
Human resources: employee records,
salaries, tax deductions
Databases touch all aspects of our lives
7
Data has no meaning and hence not helpful,
information is useful to make decisions and
control and coordinate activities
Data is input to Information System and
information is output from the system.
Example:
The numbers 18, 20, 23, 20, 25, 25, 28 can be
considered as data. But if you are told that these
are the highest temperature recordings during the
first week of the month of June, 2007, at Addis
Ababa, Ethiopia; it becomes information.
8
1.3 File-based approach Vs. Database approach
File based systems were an early attempt to
computerize manual systems.
This approach is a decentralized computerized data
handling method - it develops a program or a number of
programs for each different application.
Since every application defines and manages its own
data, the system is subjected to serious data duplication
problem
9
Example: Three file processing systems at Company A
Duplicate
Data
10
1.4 Limitations of file-based systems
Data Redundancy (Duplication of data)
Same data is held by different programs
Wasted space (Uncontrolled duplication of data)
Separation and isolation of data
Each program maintains its own set of data. Users
of one program may be unaware of potentially
useful data held by other programs.
Limited data sharing
11
Limitations of File-Based systems (Cont.)
• Data Inconsistency and confusion
There are potentially different values and/or different
formats for the same item
• Program - Data dependence
File structure is defined in the program code and is
dependent on the application programming
language.
Each application program must have its own
processing routines for reading, inserting, updating
and deleting data
12
Limitations of File Based Systems (Cont.)
Incompatible file formats (Lack of Data
Sharing and Availability)
Programs are written in different languages, and
so cannot easily access each others files.
E.g. personnel writes in C++
finance writes in COBOL
Poor Security and administration
13
Limitations of File-Based systems (Cont.)
Update Anomalies
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.
Deletion Anomalies: A problem encountered where one
record set is deleted from one application but remain
untouched in other application programs
Insertion Anomalies: A problem experienced whenever
there is a new data item to be recorded, and the
recording is not made in all the applications
14
File based approaches
15
1.5 Advantages and disadvantages of database
systems
– The Database approach was taken to overcome
the limitations of the File-based systems.
In this approach
A database is maintained.
A DBMS provides all the required services.
• Note: A DBMS is a software system that enables
users to define, create, maintain, and control access
to the database. More on this in the next chapter.
16
Benefits of Database systems
Data can be shared: two or more users can access and use
same data instead of storing data in redundant manner for
each user
Improved data accessibility: By using structured query
languages, the users can easily access data without programming
experience.
Redundancy can be reduced : Isolated data is integrated in
database to decrease the redundant data stored at different
applications.
Quality data can be maintained : the different integrity
constraints in the database approach will maintain the quality leading
to better decision making.
Inconsistency can be avoided : controlled data redundancy will
avoid inconsistency of the data in the database.
17
Benefits …
Integrity can be maintained : Data at different applications
will be integrated together with additional constraints to
facilitate 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.
Standards can be enforced: the different ways of using
and dealing with data by different units of the
organization can be balanced and standardized by using
database approach.
18
Benefits …
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.
Data Independence - Applications insulated from how
data is structured and stored
19
Limitations of database approach
Introduction of new professional and specialized
personnel
to be incurred to develop and maintain
High cost
the system
and recovery services from the
Complex backup
users perspective
High impact on the system when failure occurs to
the central system
20
1.6 Roles of people in database environment
Data administrator
Responsible for
Management of data resources
Database planning
Development of standards
Policies and procedures
Consulting users
Database administrator (more technical)
Responsible for
The physical design and implementation of databases
Security and integrity control
Maintenance
Satisfactory performance
21
Roles of people …
Database Designers
Logical Designers
Concerned with identifying the data, entities and attributes,
relationships and constraints
Need a complete knowledge of the organization's data and
business rules
Physical Designers
Decide how the logical database designer is to be physically
realized
Map the logical database design into a set of tables
Select specific storage structures and access methods
Design security measures
22
Roles of people …
Application Developers
Application programs provide the required functionality
for the end user.
Work based on the requirement specified by the system
analyst.
Each program contains statements that request the
DBMS to perform some operation on the database –
retrieving, inserting, updating and deleting data.
23
Roles of people …
End Users
End users require access to the database for querying,
updating, and generating reports; the database primarily exists
for their use.
They are differentiated by the way they expect to interact with
the system.
Naive Users
• Unaware of the DBMS and the DB
• Depend on the simplicity of the GUI
• (E.g.. Bank tellers, clerical staff)
Sophisticated Users
• Familiar with the structure of the database and the facilities of the
DBMS
• May use high-level query languages (SQL) to perform the required
operation
• May even write application program for their own use
24
1.7 The ANSI-SPARC database architecture
Database Architecture
The American National Standards Institute/
Standards Planning and Requirements
Committee (ANSI-SPARC) introduced the three-
level architecture of the database based on their
degree of abstraction.
25
Levels of Abstraction - (Three level
ANSI_SPARC architecture )
We have three distinct levels of data abstraction
at which data items can be described.
The levels form a three level architecture comprising an
an external,
a conceptual and
an internal level.
The objective of the three-level architecture is to separate
each users' view of the database from the way it is
physically represented.
26
External level :
The users’ view of the database. This level
describes part of the database that is relevant to
each user.
Each user has a view of the real world represented in a
form that is familiar for that user. For example, one user
may view dates in the form (day, month, year), while
another may view dates as (year, month, day), some
views may include derived or calculated data. That is,
data not actually stored in the database,
Entities, attributes or relationships that are not of interest
to the users may still be represented in the database, but
the users will be unaware of them.
27
Conceptual level :
the community view of the database. This level
describes what data is stored in the database
and the relationships among the data.
Conceptual level is the middle level. It is a
complete view of the data requirements of the
organization.
Any data available to a user must be contained
in, or derivable from conceptual level
28
Internal level :
the physical representation of the
database on the computer. This level
describes how the data is stored in the
database.
The internal level is concerned with such things as:
Storage space allocation for data
Record description for storage
Record placement
The way the DBMS and OS perceive the
data is the internal level.
29
External level
Sno. fname lname age Sal.
Staff_no. lname [Link].
Staff_no. fname lname DOB Sal. Br. No.
Conceptual level
Struct STAFF{
Int staff_no;
Internal level Char fname[15];
Char lname[15];
Struct date date_of_birth;
Flooat sal;
Struct staff *next
};
Difference between the three levels 30