Chapter 1
Introduction Fundamental of Database System
In this chapter it will be discussed about:
- Introduction to database and database MS
- File based vs Database system
- Characteristics of Database system approach
- Advantage of DBMS
1.1 Introduction to database system
Databases and database technology are having a major impact on the growing use of computers.
It is fair to say that databases play a critical role in almost all areas where computers are used,
including business, electronic commerce, engineering, medicine, law, education, and library
science, to name a few.
General definition of database
A database is a collection of related data. By data, we mean known facts that can be recorded and
that have implicit meaning. For example, consider the names, telephone numbers, and addresses
of the people you know. You may have recorded this data in an indexed address book, or you may
have stored it on a hard drive, using a personal computer and software such as Microsoft Access,
or Excel. This is a collection of related data with an implicit meaning and hence is a database.
A database management system (DBMS) is a collection of programs that enables users to create
and maintain a database. The DBMS is hence a general-purpose software system that facilitates
the processes of defining, constructing, manipulating, and sharing databases among various users
and applications.
Defining a database involves specifying the data types, structures, and constraints for the data to
be stored in the database.
Constructing the database is the process of storing the data itself on some storage medium that is
controlled by the DBMS.
Manipulating a database includes such functions as querying the database to retrieve specific data,
updating the database to reflect changes in the miniworld, and generating reports from the data.
Sharing a database allows multiple users and programs to access the database concurrently.
Example MySQL, SQL Server, Mango DB, Maria, PostgreSQL, SQLite, Redis etc.
[Link] based verses Database approach
1|Fundamental of database system. MU (Infosa)
File systems are used to manage files and directories, and provide basic operations for creating,
deleting, renaming and accessing files. They typically store data in hierarchical structure, where
file are organized in directories and subdirectories. File systems are simple and efficient, but they
lack the ability to manage complex data relationships and ensure data consistency. On the other
hand, DBMS is a software system designed to manage large amounts of structured data, and
provide advanced operations for storing, retrieving, and manipulation data.
Let's compare the file-based approach and the database approach:
1.2.1. File-based Approach:
Data Organization: In a file-based approach, data is organized and stored in separate files specific
to each application or task. Each file contains its own data format and structure, often customized
for the needs of a particular program.
Data Dependency: Application programs in a file-based system are highly dependent on the file
structure and format. Any changes to the file structure require modifications in all the programs
that access those files, making the system rigid and less adaptable to changes.
Data Isolation: Data in a file-based system is isolated within individual files, making it difficult
to share and access data across different applications. Data sharing and collaboration among
multiple users or programs become challenging.
Lack of Data Integrity and Security: File-based systems often lack robust mechanisms for
ensuring data integrity. Maintaining data consistency and enforcing referential integrity constraints
can be cumbersome. Additionally, security measures like access control and encryption may be
limited or absent.
1.2.2. Database Approach:
Data Centralization: The database approach centralizes data in a single database system. Data
from different applications or tasks is stored in tables, providing a unified view of the data and
reducing redundancy.
Data Independence: The database approach separates the logical structure of the database from
its physical storage. This abstraction allows for changes in the database structure without
impacting the application programs that use the data, providing flexibility and scalability.
2|Fundamental of database system. MU (Infosa)
Data Consistency and Integrity: Databases offer mechanisms for enforcing data integrity
constraints, such as primary keys and referential integrity. These constraints ensure data
consistency and accuracy, reducing the chances of data inconsistencies.
Data Sharing and Collaboration: Databases enable multiple users or applications to access and
share data concurrently. Users can access the database through a database management system
(DBMS), allowing for efficient data sharing, collaboration, and real-time access.
Data Security: Database systems provide robust security features like user authentication, access
control, and encryption to protect sensitive data from unauthorized access or manipulation. These
features enhance data security and compliance.
Data Abstraction and Querying: Databases provide high-level query languages (e.g., SQL) that
allow users to retrieve, manipulate, and analyze data using declarative statements. This abstraction
hides the complexities of data storage and retrieval, making it easier for users to interact with the
data.
Data Concurrency and Control: DBMS manages concurrent access to the database, ensuring
data integrity and preventing conflicts. Techniques like locking and transaction management are
employed to control concurrent operations and maintain data consistency.
Scalability and Performance: Databases are designed to handle large volumes of data and support
efficient data retrieval and manipulation operations. They provide optimization techniques,
indexing, and caching mechanisms to enhance system performance.
1.3. Characteristics of the Database Approach
A number of characteristics distinguish the database approach from the traditional approach of
programming with files. In traditional file processing, each user defines and implements the files
needed for a specific software application as part of programming the application. For example,
one user, the grade reporting office, may keep a file on students and their grades. Programs to print
a student's transcript and to enter new grades into the file are implemented as part of the
application. A second user, the accounting office, may keep track of students' fees and their
payments. Although both users are interested in data about students, each user maintains separate
files-and programs to manipulate these files-because each requires some data not available from
the other user's files. This redundancy in defining and storing data results in wasted storage space
3|Fundamental of database system. MU (Infosa)
and in redundant efforts to maintain common data up to date. In the database approach, a single
repository of data is maintained that is defined once and then is accessed by various users. The
main characteristics of the database approach versus the file-processing approach are the
following:
• Self-describing nature of a database system
• Isolation between programs and data, and data abstraction
• Support of multiple views of the data
• Sharing of data and multiuser transaction processing.
Approach one:
Self-Describing Nature of a Database System: A fundamental characteristic of the database
approach is that the database system contains not only the database itself but also a complete
definition or description of the database structure and constraints. This definition is stored in the
DBMS catalog, which contains information such as the structure of each file, the type and storage
format of each data item, and various constraints on the data. The information stored in the catalog
is called meta-data, and it describes the structure of the primary database.
The catalog is used by the DBMS software and also by database users who need information about
the database structure. A general-purpose DBMS software package is not written for a specific
database application, and hence it must refer to the catalog to know the structure of the files in a
specific database, such as the type and format of data it will access. The DBMS software must
work equally well with any number of database applications-for example, a university database, a
banking database, or a company database-as long as the database definition is stored in the catalog.
In traditional file processing, data definition is typically part of the application programs
themselves. Hence, these programs are constrained to work with only one specific database, whose
structure is declared in the application programs. For example, an application program written in
c++ may have struct or class declarations, and a COBOL program has Data Division statements to
define its files.
Approach Two:
Isolation between Programs and Data, and Data Abstraction: In traditional file processing, the
structure of data files is embedded in the application programs, so any changes to the structure of
a file may require changing all programs that access this file. By contrast, DBMS access programs
4|Fundamental of database system. MU (Infosa)
do not require such changes in most cases. The structure of data files is stored in the DBMS catalog
separately from the access programs. We call this property program-data independence. For
example, a file access program may be written in such a way that it can access only STUDENT
records of the structure. If we want to add another piece of data to each STUDENT record, say the
BirthDate, such a program will no longer work and must be changed. By contrast, in a DBMS
environment, we just need to change the description of STUDENT records in the catalog to reflect
the inclusion of the new data item BirthDate; no programs are changed.
An operation (also called a function or method) is specified in two parts. The interface (or
signature) of an operation includes the operation name and the data types of its arguments (or
parameters). The implementation (or method) of the operation is specified separately and can be
changed without affecting the interface. User application programs can operate on the data by
invoking these operations through their names and arguments, regardless of how the operations
are implemented. This may be termed program-operation independence. The characteristic that
allows program-data independence and program-operation independence is called data
abstraction. A DBMS provides users with a conceptual representation of data that does not include
many of the details of how the data is stored or how the operations are implemented. Informally,
a data model is a type of data abstraction that is used to provide this conceptual representation.
The data model uses logical concepts, such as objects, their properties, and their interrelationships,
that may be easier for most users to understand than computer storage concepts
Approach Three:
Support of Multiple Views of the Data: A database typically has many users, each of whom may
require a different perspective or view of the database. A view may be a subset of the database or
it may contain virtual data that is derived from the database files but is not explicitly stored. Some
users may not need to be aware of whether the data they refer to is stored or derived. A multiuser
DBMS whose users have a variety of distinct applications must provide facilities for defining
multiple views. For example, one user of the database of may be interested only in accessing and
printing the transcript of each student; the view for this user
Approach Four:
Sharing of Data and Multiuser Transaction Processing A multiuser DBMS, as its name implies,
must allow multiple users to access the database at the same time. This is essential if data for
5|Fundamental of database system. MU (Infosa)
multiple applications is to be integrated and maintained in a single database. The DBMS must
include concurrency control software 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. For example, when several
reservation clerks try to assign a seat on an airline flight, the DBMS should ensure that each seat
can be accessed by only one clerk at a time for assignment to a passenger. These types of
applications are generally called online transaction processing (OLTP) applications. A
fundamental role of multiuser DBMS software is to ensure that concurrent transactions operate
correctly. The concept of a transaction has become central to many database applications. A
transaction is an executing program or process that includes one or more database accesses, such
as reading or updating of database records. Each transaction is supposed to execute a logically
correct database access if executed in its entirety without interference from other transactions. The
DBMS must enforce several transaction properties. The isolation property ensures that each
transaction appears to execute in isolation from other transactions, even though hundreds of
transactions may be executing concurrently. The atomicity property ensures that either all the
database operations in a transaction are executed or none are.
[Link] and actors of Database system
For a small personal database one person typically defines, constructs, and manipulates the
database, and there is no sharing. However, many persons are involved in the design, use, and
maintenance of a large database with hundreds of users. In this section we identify the people
whose jobs involve the day-to-day use of a large database; we call them the "actors on the scene."
1.4.1. Database Administrators
In any organization where many persons use the same resources, there is a need for a chief
administrator to oversee and manage these resources. In a database environment, the primary
resource is the database itself, and the secondary resource is the DBMS and related software.
Administering these resources is the responsibility of the database administrator (DBA). The DBA
is responsible for authorizing access to the database, for coordinating and monitoring its use, and
for acquiring software and hardware resources as needed. The DBA is accountable for problems
such as breach of security or poor system response time.
1.4.2. Database Designers
6|Fundamental of database system. MU (Infosa)
Database designers are responsible for identifying the data to be stored in the database and for
choosing appropriate structures to represent and store this data. These tasks are mostly undertaken
before the database is actually implemented and populated with data. It is the responsibility of
database designers to communicate with all prospective database users in order to understand their
requirements, and to come up with a design that meets these requirements. In many cases, the
designers are on the staff of the DBA and may be assigned other staff responsibilities after the
database design is completed. Database designers typically interact with each potential group of
users and develop views of the database that meet the data and processing requirements of these
groups. Each view is then analyzed and integrated with the views of other user groups.
1.4.3. End Users
End users are the people whose jobs require access to the database for querying, updating, and
generating reports; the database primarily exists for their use. There are several categories of end
users:
• Casual end users occasionally access the database, but they may need different information
each time. They use a sophisticated database query language to specify their requests and are
typically middle- or high-level managers or other occasional browsers.
• Naive or parametric end users make up a sizable portion of database end users. Their main
job function revolves around constantly querying and updating the database, using standard
types of queries and updates-called canned transactions-that have been carefully programmed
and tested. The tasks that such users perform are varied: Bank tellers check account balances
and post withdrawals and deposits. Reservation clerks fur airlines, hotels, and car rental
companies check availability for a given request and make reservations. Clerks at receiving
stations for courier mail enter package identifications via bar codes and descriptive information
through buttons to update a central database of received and in-transit packages.
• Sophisticated end users include engineers, scientists, business analysts, and others who
thoroughly familiarize themselves with the facilities of the DBMS so as to implement their
applications to meet their complex requirements.
• Stand-alone users maintain personal databases by using ready-made program packages that
provide easy-to-use menu-based or graphics-based interfaces. An example is the user of a tax
package that stores a variety of personal financial data for tax purposes
7|Fundamental of database system. MU (Infosa)
[Link] Of Using The DBMS Approach
The DBMS (Database Management System) approach offers several advantages over traditional
file-based systems. Here are some of the key advantages:
[Link] Centralization and Integration: DBMS allows for the centralization of data in a single
database, eliminating data redundancy and providing a unified view of information. This
integration improves data consistency and accuracy, as updates and modifications are applied
to a single, shared database.
2. Data Independence: DBMS provides data independence, separating the logical structure of the
database from its physical storage. This means that changes to the database structure (e.g.,
adding or modifying tables) can be made without affecting the application programs that use
the data. It enhances flexibility, scalability, and maintenance of the system.
[Link] Integrity and Security: DBMS offers mechanisms to enforce data integrity constraints,
ensuring that the data stored in the database is accurate and consistent. It provides features such
as referential integrity, constraints, and transaction management, which help maintain data
quality. Additionally, DBMS provides security features like user authentication, access control,
and encryption to protect sensitive data from unauthorized access.
[Link] Concurrency and Control: DBMS enables concurrent access to the database by multiple
users or applications while maintaining data consistency. It manages concurrent transactions
through techniques such as locking and transaction isolation levels to ensure data integrity and
prevent conflicts. DBMS also provides mechanisms for data backup, recovery, and disaster
management, reducing the risk of data loss.
[Link] Data Sharing and Collaboration: DBMS allows for simultaneous access to data by
multiple users or applications, facilitating data sharing and collaboration. It supports concurrent
operations and provides tools for managing concurrent access and resolving conflicts. This
enables efficient sharing of information, enhances productivity, and supports collaborative
decision-making.
[Link] Abstraction and Querying: DBMS provides a high-level query language (e.g., SQL) that
allows users to retrieve, manipulate, and analyze data using declarative statements. This
abstraction hides the complexities of data storage and retrieval, making it easier for users to
interact with the database and obtain the desired information.
8|Fundamental of database system. MU (Infosa)
[Link] Development and Maintenance: DBMS simplifies application development and
maintenance by providing data management functionalities. It offers tools and utilities for
database design, query optimization, performance tuning, and data administration. This
streamlines application development, reduces development time, and improves overall system
efficiency.
[Link] Efficiency: Although implementing a DBMS incurs initial costs, it can lead to long-term
cost savings. By centralizing and integrating data, organizations can eliminate data redundancy
and reduce storage costs. DBMS also improves data accessibility and availability, leading to
better decision-making and potentially higher revenue generation.
In summary, the DBMS approach offers advantages such as data centralization, data independence,
data integrity, security, concurrency control, data sharing, data abstraction, and cost efficiency.
These benefits contribute to improved data management, application development, collaboration,
and overall system performance.
9|Fundamental of database system. MU (Infosa)