DBMS (R23) UNIT - 1
DBMS (R23) UNIT - 1
II B.TECH II YEAR
Regulations : R23
Branch : CSE
Prepared By
UNIT I: Introduction
Syllabus:
Introduction: Database system, Characteristics (Database Vs File System),
Database
Users (Actors on Scene, Workers behind the scene), Advantages of Database systems,
Database applications. Brief introduction of different Data Models; Concepts of
Schema, Instance and data independence; Three tier schema architecture for data
independence; Database system structure, environment, Centralized and Client Server
architecture for the database.
DATABASE MANAGEMENT SYSTEMS UNIT – I : INTRODUCTION
Introduction
The information storage and retrieval has become very important in our day-to-day life. The old era
of manual system is no longer used in most of the places. For example, to book your airline
tickets or to deposit your money in the bank the database systems may be used. The database
system makes most of the operations automated. A very good example for this is the billing
system used for the items purchased in a super market. Obviously this is done with the help of
a database application package. Inventory systems used in a drug store or in a manufacturing
industry are some more examples of database. We can add similar kind of examples to this list.
Apart from these traditional database systems, more sophisticated database systems are used in the
Internet where a large amount of information is stored and retrieved with efficient search
engines. For instance, http://www.google.com is a famous web site that enables users to
search for their favorite information on the net. In a database we can store starting from text
data to very complex data like audio, video, etc.
A database is a collection of related data stored in a standard format, designed to be shared by multiple
users. A database is defined as “A collection of interrelated data items that can be processed by one
or more application programs”.
A database can also be defined as “A collection of persistent data that is used by the application
systems of some given enterprise”. An enterprise can be a single individual (with a small
personal database), or a complete corporation or similar large body (with a large shared
database), or anything in between.
Data
Data is the raw material from which useful information is derived. The word data is the plural of
Datum. Data is commonly used in both singular and plural forms. It is defined as raw facts or
observations. It takes variety of forms, including numeric data, text and voice and images. Data
is a collection of facts, which is unorganized but can be made organized into useful
information. The term Data and Information come across in our daily life and are often
interchanged.
Example: Weights, prices, costs, number of items sold etc.
Information
Data that have been processed in such a way as to increase the knowledge of the person who uses
the data. The term data and information are closely related. Data are raw material resources
that are processed into finished information products. The information as data that has been
processed in such way that it can increase the knowledge of the person who uses it.
In practice, the database today may contain either data or information.
Data Processing
The process of converting the facts into meaningful information is known as data processing. Data
processing is also known as information processing.
Metadata
Data that describe the properties or characteristics of other data.
1
DATABASE MANAGEMENT SYSTEMS UNIT – I : INTRODUCTION
Data is only become useful when placed in some context. The primary mechanism for
providing context for data is Metadata. Metadata are data that describe the properties, or
characteristics of other data. Some of these properties include data definition, data structures
and rules or constraints. The Metadata describes the properties of data but do not include that
data.
1. Not enough primary memory to process large data sets. If data is maintained in other
storage devices like disks, tapes and bringing relevant data to main memory, it increases
the cost of performance. Problem in accessing the large data due to addressing the data
using 32 bit or 64 bit mode addressing mechanism.
2. Programs must be written to process the user request to process the data stored in files
which are complex in nature because of large volume of data to be searched.
3. Inconsistent data and complexity in providing concurrent accesses.
4. Not sufficiently flexible to enforce security policies in which different users have
permission to access different subsets of the data.
A DBMS is a piece of software that is designed to make the preceding tasks easier. By storing
data in a DBMS, rather than as a collection of operating system Files, we can use the DBMS's
features to manage the data in a robust and efficient manner.
2
DATABASE MANAGEMENT SYSTEMS UNIT – I : INTRODUCTION
One of the main advantages of using a database management system is that the organization
can exert via the DBA, centralized management and control over the data. The database
administrator is the focus of the centralized control.
The following are the major advantages of using a Database Management System (DBMS):
Data independence: Application programs should be as independent as possible from
details of data representation and storage. The DBMS can provide an abstract view of the
data to insulate application code from such details.
Data integrity and security: The DBMS can enforce integrity constraints on the data.
The DBMS can enforce access controls that govern what data is visible to different classes of
users.
Data administration: When several users share the data, centralizing the administration of
data can offer significant improvements. It can be used for organizing the data representation to
minimize redundancy and for fine-tuning the storage of the data to make retrieval efficient.
Concurrent access and crash recovery: A DBMS schedules concurrent accesses to the
data in such a manner that users can think of the data as being accessed by only one user at a time.
Further, the DBMS protects users from the effects of system failures. .
Even though centralization reduces duplication, the lack of duplication requires that the
database be adequately backup so that in the case of failure the data can be recovered.
Backup and recovery operations are complex in a DBMS environment, and this is an increment
in a concurrent multi-user database system. A database system requires a certain amount of
controlled redundancies and duplication to enable access to related data items.
A schema is a description of a particular collection of data, using the given data model. The
relational model of data is the most widely used model today.
3
DATABASE MANAGEMENT SYSTEMS UNIT – I : INTRODUCTION
Conceptual (high-level, semantic) data models: Provide concepts that are close
to the way many users perceive data (Also called entity-based or object-based data models).
Physical (low-level, internal) data models: Provide concepts that describe details of
how data is stored in the computer.
Implementation (representational) data models: Provide concepts that fall
between the above two.
1. Hierarchical models:
Advantages:
Hierarchical model is simple to construct and operate on.
Corresponds to a number of natural hierarchical organized domains – e.g., assemblies
in manufacturing, personal organization in companies.
Language is simple; uses constructs like GET, GET UNIQUE, GET NEXT, GET NEXT WITHIN
PARENT etc.,
Disadvantages:
Navigational and procedural nature of processing.
Database is visualized as a linear arrangement of records.
Little scope for “query optimization”.
One-to-many relationships.
2. Network model:
Advantages:
4
DATABASE MANAGEMENT SYSTEMS UNIT – I : INTRODUCTION
3. Relational model:
A relation, basically a table with rows and columns.
Every relation has a schema, which describes the columns, or fields.
Student information in a university database may be stored in a relation with the following
schema
Students (sid: string, name: string, login: string, age: integer, gpa: real)
Conceptual schema:
The conceptual schema(also called as logical schema) describes the stored data in terms of the
data model of the DBMS.
In a relational DBMS, the conceptual schema describes all relations that are stored in the
database.
In our sample university database, these relations contain information about entities, such as
students and faculty, and about relationships, such as students’ enrollment in courses.
Students(sid: string, name: string, login: string, age: integer, gpa:
real)
Faculty(fid: string, fname: string, salary : real)
Courses(cid: string, cname: string, credits: integer)
Rooms(nw: integer, address: string, capacity: integer)
Enrolled (sid: string, cid: string, grade: string)
Teaches (fid: string, cid: string)
5
DATABASE MANAGEMENT SYSTEMS UNIT – I : INTRODUCTION
The choice of relations, and the choice of fields for each relation, is not always obvious, and
the process of arriving at a good conceptual schema is called conceptual database design.
Physical Schema:
External Schema:
This schema allows data access to be customized at the level of individual users or groups of
users.
A database has exactly one conceptual schema and one physical schema, but it may have
several external schemas.
An external schema is a collection of one or more views and relations from the conceptual
schema.
A view is conceptually a relation, but the records in a view are not stored in the DBMS.
6
DATABASE MANAGEMENT SYSTEMS UNIT – I : INTRODUCTION
metadata.
4. Transaction Manager: Ensures that the database remains in a consistent (correct) state
despite system failures, and that concurrent transaction executions proceed without
conflicting.
5. File Manager: Manages the allocation of space on disk storage and the data structures
used to represent information stored on disk.
6. Buffer Manager: Is responsible for fetching data from disk storage into main memory
and deciding what data to cache in memory.
Also some data structures are required as part of the physical system implementation:
1. Data Files: The data files store the database by itself.
2. Data Dictionary: It stores metadata about the structure of the database, as it is used heavily.
3. Indices: It provides fast access to data items that hold particular values.
4. Statistical Data: It stores statistical information about the data in the database.
This information used by the query processor to select efficient ways to execute a query.
7
DATABASE MANAGEMENT SYSTEMS UNIT – I : INTRODUCTION
In addition to end users and implementors, two other classes of people are associated with a
DBMS: application programmers and database administrators (DBAs).
Database application programmers develop packages that facilitate data access for
end users, who are usually not computer professionals, using the host or data languages and
software tools that DBMS vendors provide.
The task of designing and maintaining the database is entrusted to a professional called the
database administrator.
Design of the conceptual and physical schemas: The DBA is responsible for
interacting with the users of the system to understand what data is to be stored in the
DBMS and how it is likely to be used. Based on this knowledge, the DBA must design the
conceptual schema (decide what relations to store) and the physical schema (decide how to store
them).
Security and authorization: The DBA is responsible for ensuring that unauthorized
data access is not permitted. In general, not everyone should be able to access all the data. In a
relational DBMS, users can be granted permission to access only certain views and relations.
Data availability and recovery from failures: The DBA must take steps to ensure
that if the system fails, users can continue to access as much of the uncorrupted data as
possible.
Database tuning: The needs of users are likely to evolve with time. The DBA is
responsible for modifying the database, in particular the conceptual and physical schemas, to
ensure adequate performance as user requirements change.
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 mini world, and generating reports from the
data.
Sharing a database allows multiple users and programs to access the database concurrently.
Other important functions provided by the DBMS include protecting the database and
maintaining
it over a long period of time.
Protection includes both system protection against hardware or software malfunction (or
crashes), and security protection against unauthorized or malicious access. A typical large
database may have a life cycle of many years, so the DBMS must be able to maintain the database
system by allowing the system to evolve as requirements change over time. We can call the
database and DBMS software together a database system.
8
DATABASE MANAGEMENT SYSTEMS UNIT – I : INTRODUCTION
The architecture of a DBMS can be seen as either single tier or multi-tier. The tiers are classified as
follows:
1- tier architecture
2- tier architecture
3- tier architecture
n-tier architecture
1- tier architecture:
One-tier architecture involves putting all of the required components for a software application
or technology on a single server or platform.
9
DATABASE MANAGEMENT SYSTEMS UNIT – I : INTRODUCTION
2- tier architecture:
The two-tier is based on Client Server architecture. The two-tier architecture is like client server
application. The direct communication takes place between client and server. There is no
intermediate between client and server.
3- tier architecture:
A 3-tier architecture separates its tiers from each other based on the complexity of the users and
how they use the data present in the database. It is the most widely used architecture to design a
DBMS.
10
DATABASE MANAGEMENT SYSTEMS UNIT – I : INTRODUCTION
As prices of hardware declined, most users replaced their terminals with personal computers
(PCs) and workstations. At first, database systems used these computers in the same way as
they had used display terminals, so that the DBMS itself was still a centralized DBMS in which all
the DBMS functionality, application program execution, and user interface processing were
carried out on one machine.
Gradually, DBMS systems started to exploit the available processing power at the user side,
which led to client/server DBMS architectures.
The resources provided by specialized servers can be accessed by many client machines. The
client machines provide the user with the appropriate interfaces to utilize these servers, as well
as with local processing power to run local applications. This concept can be carried over to
software, with specialized software-such as a DBMS or a CAD (computer-aided design) package
being stored on specific server machines and being made accessible to multiple clients.
11
DATABASE MANAGEMENT SYSTEMS UNIT – I : INTRODUCTION
requires access to additional functionality-such as database access-that does not exist at that
machine, it connects to a server that provides the needed functionality.
A server is a machine that can provide services to the client machines, such as file access,
printing, archiving, or database access. In the general case, some machines install only client
software, others only server software, and still others may include both client and server
software. However, it is more common that client and server software usually run on separate
machines.
In client/server architecture, the user interface programs and application programs can run on
the client side. When DBMS access is required, the program establishes a connection to the DBMS
(which is on the server side); once the connection is created, the client program can communicate
with the DBMS. A standard called Open Database Connectivity (ODBC) provides an application
programming interface (API), which allows client-side programs to call the DBMS, as long as
both client and server machines have the necessary software installed. Most DBMS vendors
provide ODBC drivers for their systems.
Review Questions
12
DATABASE MANAGEMENT SYSTEMS UNIT – I : INTRODUCTION
13. Who are the different database users? Explain their interfaces to database management
system.
14. Describe the client server architecture for the database with necessary diagram.
15. Define Schema. Explain three level architecture in DBMS.
16. Explain Data Independence and its types in detail.
17. How does DBMS provide data abstraction? Explain the concept of data independence.
18. With a neat diagram describe the overall system structure of DBMS.
13