C1 DBMS
C1 DBMS
system
Mrs Shruthi K N, BE, M Tech
Assistant professor
RR Institute Of Technology
PREFACE
• Databases and database systems are an essential component of life in modern
society. Most of us encounter several activities everyday that involve some
interaction with a database. These interactions are examples of what we may call
traditional database applications, in which most of the information that is stored
and accessed is either textual or numeric.
• The proliferation of social media websites, such as Facebook, Twitter, and Flickr,
among many others, has required the creation of huge databases that store
nontraditional data, such as posts, tweets, images and video clips.
PREFACE
• New types of database systems, often referred to as big data storage systems, or
NOSQL systems, have been created to manage data for social media applications.
These types of systems are also used to manage the data required in their web
search as well as to provide cloud storage.
• Files containing images, audio clips and video streams has become an important
component of multimedia databases.
• GIS, Datawarehouses, OLAP, Real-time and active database technology, search
techniques are some other applications of databases.
1.1 INTRODUCTION
• Data is facts that can be recorded and have implicit meaning. A Database is
collection of related data.
• A database has the following implicit properties:
➢ A database represents some aspect of the real world, sometimes called miniworld or
universe of discourse(UoD).
➢ A database is logically coherent collection of data with some inherent meaning.
➢ A database is designed, built and populated with data for a specific purpose.
1.1 INTRODUCTION
• Database can be of any size and complexity. Earlier, the list of names and
addresses consisted of only few hundred records, each with simple structure. On
the other hand, the computerized catalog of a large library may contain half a
million entries organized under different categories. Ex of large commercial
database is Amazon.com.
• A Database management system (DBMS) is a computerized system that enables
users to create and maintain a database. The DBMS is a general-purpose software
system that facilitates the processes of defining, constructing, manipulating, and
sharing databases among various users and applications.
1.1 INTRODUCTION
➢ Defining a database involves specifying data types, structures, and constraints of
the data.(Meta-data: It is the database definition or descriptive information stored in
the form of database catalog).
➢ Constructing the database is the process of storing the data on some storage
medium that is controlled by the DBMS.
➢ Manipulating a database includes functions such as querying the database to
retrieve specific data, updating the database and generating reports from the data.
➢ Sharing a database allows multiple users and programs to access the database
simultaneously.
1.1 INTRODUCTION
• An application program accesses the database by sending queries or requests for
data to the DBMS. A query typically causes some data to be retrieved; a transaction
may cause some data to be read and some data to be written into the database.
• Other important functions provided by DBMS include protecting the database and
maintaining it over long period of time.
• Database system is database and DBMS software together.
1.2 An Example
• A UNIVERSITY database for maintaining information concerning students,
courses and grades in a university environment. The database is organized as five
files, each of which stores data records of the same type. The STUDENT file stores
data on each student, the course file stores data on each course, the SECTION file
stores data on each section of a course, the GRADE_REPORT file stores the
grades that students receive in the various sections they have completed, and
PREREQUISITE file stores the prerequisites of each course.
1.2 An Example
• To define database we must specify structure of records of each file by specifying
different types of data elements to be stored in each record.
• We must also specify data type for each data element within a record.
• Ex: STUDENT name is string of alphanumeric characters, STUDENT number is
int.
• Records in various files may be related.
• Design of database starts off with Requirements specification and analysis where
requirements are documented in detail and transformed into conceptual design, that
can be represented and manipulated using some computerized tools. The design is
then translated into a logical design that can be expressed in a data model. Final stage
is Physical design during which further specifications are provided for storing and
accessing the database.
DATABASE THAT STORES
STUDENT
AND COURSE INFORMATION
1.3 CHARACTERISTICS OF DATABASE
APPROACH
• A number of characteristics distinguish the database approach from the much older
approach of writing customised programs to access data stored in files.
Main characteristics of DBMS are:
➢ Self Describing Nature of Database system
Database system contains database and also a complete definition or description of
the database structure and constraints. Data is stored as self describing data that
includes the data item names and data values together in one structure.
A general purpose DBMS software must work equally well with any number of
database applications.
1.3 CHARACTERISTICS OF DATABASE
APPROACH
Unlike traditional file processing, DBMS software can access diverse databases by
extracting the database definitions from the catalog and using these definitions.
➢ Insulation between programs and data and data abstraction
In traditional file system since the structure of datafile is embedded in the application
program, any changes to structure of a file may require changing all programs that
access that file.
In contrast, DBMS access programs do not require such changes because the structure
of the datafile is stored in metadata which is separate from the access programs. This
is known as program data independence.
1.3 CHARACTERISTICS OF DATABASE
APPROACH
In some types of database systems, users can define operations on data as part of the
database definitions. An operation is specified in two parts: interface and
implementation. 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 is termed as program-operation independence.
Data abstraction –It is the characteristic that allows program data independence and
program operation independence. DBMS provides users with a conceptual
representation of data that does not include many of the details of how data is stored
or how the operations are implemented. Data model is a type of data abstraction that
is used to provide conceptual representation.
1.3 CHARACTERISTICS OF DATABASE
APPROACH
➢ 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 multiuser DBMS facilitates for defining multiple views for
variety of users.
➢ Sharing of data and multiuser transaction processing:
A multiuser DBMS must allow multiple users to access the database at the same time.
This is essential if data for multiple applications is to be integrated and maintained in a
single database. 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.
Ex Ticket booking system.
1.4 ACTORS ON THE SCENE
• These are the people whose jobs involve the day to day use of large database.
➢ Database administrators:
In a database environment, the primary resource is the database itself, and the
secondary resource is the DBMS and related software. Database administrator (DBA)
administers these resources. DBA is responsible for authorizing access to the database,
coordinating and monitoring its use, and acquiring software and hardware resources as
needed.
1.4 ACTORS ON THE SCENE
➢ Database designers: They are responsible for identifying the data to be stored in
the database and for choosing appropriate structures to represent and store this
data. It is the responsibility of database designers to communicate with all
prospective database users in order to understand their requirements and to create a
design that meets these requirements. They develop views of the database that meet
the data and processing requirements of different user groups.
1.4 ACTORS ON THE SCENE
➢ End users are the people whose jobs require access to the database for querying,
updating and generating reports.
✓ Casual end users occasionally access the database, but they may need different
information each time. They use sophisticated database query interface.
✓ Naïve or parametric end users: Their main job revolves around constantly querying
and updating the database, using standard types of queries and updates called
canned transactions. Ex: Bank customers.
1.4 ACTORS ON THE SCENE
✓ Sophisticated end user: It includes engineers, scientists, business analysts and others
who thoroughly familiarise themselves with the facilities of the DBMS in order to
implement their own applications to meet their complex requirements.
✓ Standalone users: These users maintain personal databases by using ready-made
program packages that provide easy-to-use menu-based or graphic-based interfaces.
Ex: User of financial software package.
1.4 ACTORS ON THE SCENE
➢ System Analysts and Application Programmers(Software Engineers):
System Analysts determine the requirements of end users and develop specifications
for standard canned transactions that meet these requirements.
Application programmers implement these specifications as programs, then they test,
debug, document and maintain these canned transactions. Such analysts and
programmers referred to as software developers or software engineers should be
familiar with full range of capabilities provided by the DBMS to accomplish their
tasks.
1.5 WORKERS BEHIND THE SCENE
• These people are associated with the design, development, and operation of the
DBMS software and system environment.
➢ DBMS system designers and implementers : They design and implement the
DBMS modules and interfaces as a software package. A DBMS is a very complex
software system that consists of many components, or modules, including modules
for implementing the catalog, query language processing, interface processing,
accessing and buffering data, controlling concurrency, and handling data recovery
and security.
1.5 WORKERS BEHIND THE SCENE
➢ Tool developers design and implement tools. The software packages that facilitate
database modeling and design, database system design and improved performance.
Tools are optional packages that are purchased separately.
➢ Operators and maintenance personnel : They are responsible for the actual
running and maintenance of the hardware and software environment for the
database system.
1.6 ADVANTAGES OF USING DATABASE
APPROACH
➢Controlling Redundancy
In traditional software development utilizing file processing, every user group
maintains its own files for handling its data-processing applications. First, there is the
need to perform a single logical update-such as entering data on a new student –
multiple times: once for each file where student data is recorded. This leads to
duplication of effort. Second, storage space is wasted when the same data is stored
repeatedly. Third, files that represent the same data may become inconsistent because
the updates are applied to some of the files and not others.
1.6 ADVANTAGES OF USING DATABASE
APPROACH
• In Database approach, the views of different user groups are integrated
during database design. We should have a database design that stores each
logical data item in only one place in the database. This is known as data
normalisation, it ensures consistency and saves storage space.
• Controlled redundancy is used to improve the performance of queries. This
is known as denormalization. In such cases DBMS should have the capability
to control this redundancy in order to prohibit inconsistencies among the
files.
1.6 ADVANTAGES OF USING DATABASE
APPROACH
➢ Restricting Unauthorized access:
When multiple users share a large database, it is likely that most users will not
be authorized to access all information in the database. A DBMS should
provide a security and authorization subsystem, which the DBA uses to create
accounts and to specify account restrictions. Similar controls can be applied to
the DBMS software. Ex: Only DBA’s staff may be allowed to use certain
privileged software.
1.6 ADVANTAGES OF USING DATABASE
APPROACH
➢ Providing Persistent Storage for Program Objects
Databases can be used to provide persistent storage for program objects and
data structures. This is one of the main reasons for object-oriented database
systems. Object oriented database systems are compatible with programming
languages such as C++ and Java, and the DBMS software automatically
performs any necessary conversions. Hence a complex object in C++ can be
stored permanently in an object-orented DBMS. Such an object is said to be
persistent, since it survives the termination of program execution and can later
be directly retrieved by another program.
1.6 ADVANTAGES OF USING DATABASE
APPROACH
➢ Providing Storage Structures and Search Techniques for Efficient
Query Processing
Database systems must provide capabilities for efficiently executing queries
and updates. Indexes are used to speed up disk search. As data buffering is
crucial to DBMS performance, most DBMSs have their own data buffering and
caching module.
Query processing and Optimisation module of DBMS is responsible for
choosing an efficient query execution plan for each query based on the existing
storage structures.
1.6 ADVANTAGES OF USING DATABASE
APPROACH
➢ Providing Backup and Recovery
DBMS must provide facilities for recovering from hardware and software failures. The
backup and recovery subsystem of the DBMS is responsible for recovery.
➢ Providing Multiple User Interfaces
Because many types of users with varying levels of technical knowledge use a
database, a DBMS should provide a variety of user interfaces.
➢ Representing Complex Relationships among Data
A database may include numerous varieties of data that are interrelated in many ways.
A DBMS must have the capability to represent a variety of complex relationships
among the data, to define new relationships as they arise, and to retrieve and update
related data easily and efficiently.
1.6 ADVANTAGES OF USING DATABASE
APPROACH
➢ Enforcing Integrity Constraints
Most database applications have certain integrity constraints that must hold for the
data. A DBMS must provide capabilities for defining and enforcing these constraints.
The simplest type of integrity constraint involves specifying a data type for each data
item. A more complex type of constraint that frequently occurs involves specifying
that a record in one file must be related to records in other files. This is known as
referential integrity constraint.
Key or uniqueness constraint specifies uniqueness on data item values.
Business rules are the constraints which may have to be checked by update programs
or at the time of data entry.
1.6 ADVANTAGES OF USING DATABASE
APPROACH
➢ Permitting Inferencing and Actions Using Rules and Triggers
Some database systems provide capabilities for defining deduction rules for
inferencing new information from the stored database facts. Such systems are
called deductive database systems.
In todays’ relational database systems it is possible to associate triggers with
tables. A trigger is a form of a rule activated by updates to the table, which
results in performing some additional operations to some other tables, sending
messages and so on.
1.6 ADVANTAGES OF USING DATABASE
APPROACH
More involved procedures to enforce rules are popularly called stored
procedures, which are invoked appropriately when certain conditions are met.
More powerful functionality is provided by active database systems which
provide active rules that can automatically initiate actions when certain events
and conditions occur.
1.6 ADVANTAGES OF USING DATABASE
APPROACH
➢ Additional Implications of Using the Database Approach
✓ Potential for enforcing standards: The database approach permits DBA to
define and enforce standards among database users in a large organisation.
✓ Reduced Application Development Time
Once a database is up and running, substantially less time is generally required
to create new applications using DBMS facilities.
1.6 ADVANTAGES OF USING DATABASE
APPROACH
✓ Flexibility
DBMSs allow certain types of evolutionary changes to the structure of the
database without affecting the stored data and existing application programs.
✓ Availability of Up-to-Date Information
A DBMS makes data available to all users and gives up-to-date information. It
is made possible by the concurrency control and recovery subsystems of a
DBMS.
1.6 ADVANTAGES OF USING DATABASE
APPROACH
✓ Economies of Scale: The DBMS approach permits consolidation of data
and applications, thus reducing the amount of wasteful overlap between
activities of data-processing personnel in different projects or departments
as well as redundancies among applications.
1.7 A BRIEF HISTORY OF DATABASE
APPLICATIONS
➢ Early Database Applications Using Hierarchical and Network Systems
One of the main problem of early database systems was the intermixing of
conceptual relationships with the physical storage and placement of records on
disk. Hence these systems did not provide sufficient data abstraction and
program data independence capabilities.
Another shortcoming was that they provided only programming language
interfaces. This made it time-consuming and expensive to implement new
queries and transactions.
1.7 A BRIEF HISTORY OF DATABASE
APPLICATIONS
➢ Providing Data Abstraction and application Flexibility with Relational
Databases
The relational data model introduced high level language making it much faster
to write queries. Relational systems provided flexibility to develop new queries
quickly and to reorganize the database as requirements changed. Hence data
abstraction and program data independence were much improved.
1.7 A BRIEF HISTORY OF DATABASE
APPLICATIONS
➢ Object-Oriented Applications and the Need for More Complex Databases.
The need to store and share complex, structured objects led to the development of
object-oriented databases(OODBs). They also incorporated many of the useful object-
oriented paradigms such as abstract data types, encapsulation of operations,
inheritance and object identity.
➢ Interchanging Data on the Web for E-commerce Using XML
The World Wide Web provides a large network of interconnected computers. Much of
the critical information on e-commerce Web pages is dynamically extracted data from
DBMSs. A variety of techniques were developed to allow the interchange of
dynamically extracted data on the Web for display on Web pages.
1.7 A BRIEF HISTORY OF DATABASE
APPLICATIONS
➢ Extending database capabilities for new applications
Database systems offer extensions to better support the specialised requirements for
some of the applications. Ex Scientific applications, storage and retrieval of images
and videos, data mining, spatial applications, time series.
➢ Emergence of Big Data and NOSQL Databases
New types of database systems were necessary to manage huge databases-systems that
provide fast search and retrieval as well as reliable and safe storage of non traditional
types of data, such as social media posts and tweets. Some of the requirements of
these new systems were not compatible with SQL relational DBMSs. Term NOSQL
means that some of the data is stored using SQL systems, whereas other data would be
stored using NOSQL.
1.8 WHEN NOT TO USE A DBMS
• In spite of advantages of using DBMS, there are few situations in which
DBMS may involve unnecessary overhead costs, which incur due to :
✓ High initial investment
✓ Generality that a DBMS provides for defining and processing data
✓ Overhead for providing security, concurrency control, recovery and integrity
functions.
1.8 WHEN NOT TO USE A DBMS
• It is more desirable to develop customised database applications under the
following circumstances:
✓ Simple, well defined database applications
✓ Stringent, real time requirements for some application programs.
✓ Embedded systems with limited storage capacity
✓ No multiple user access to data.