Unit 1
Unit 1
Unit 1
Satyanarayana Reddy
UNIT 1
Unit – I: INTRODUCTION Database system, Characteristics (Database Vs File System), Database Users(Actors on Scene, Workers
behind the scene), Advantages of Data base 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.
Data: Data is meaningful known raw facts that can be processed and stored as information.
Database: Database is a collection of interrelated and organized data. In general, it is a collection of files.
Any database which is collection of data, typically describes the activities of one or more related
organizations. A database management system (DBMS) is a software designed to assist in maintaining and
utilizing large collections of data. A DBMS contains information pertaining to a particular enterprise.
Database Management System: Any Database Management System is
A collection of interrelated data
A set of programs to access the data
An environment, which is efficient and convenient to use.
History:
First general-purpose DBMS, designed by Charles Bachman in the early 1960s which formed as basis
for network data model which strongly influenced database systems through the 1960s. In the late 1960s, IBM
developed the Information Management System (IMS) DBMS, which formed the basis for an alternative data
representation framework called the hierarchical data model.
In 1970, Edgar Codd, at IBM's San Jose Research Laboratory, proposed a new data representation
framework called the relational data model.
In the 1980s, the relational model consolidated its position as the dominant DBMS paradigm, and
database systems continued to gain widespread use. The SQL query language for relational databases,
developed as part of IBM's System R project, is now the standard query language.
In the late 1980s and the 1990s, advances were made in many areas of database systems. Considerable
research was carried out into more powerful query languages and richer data models, with emphasis placed on
supporting complex analysis of data from all parts of an enterprise.
Database management continues to gain importance as more and more data is brought online and made
ever more accessible through computer networking. Commercially, database management systems represent
one of the largest and most vigorous market segments.
Applications of DBMS:
Databases touch every area of our life. The list of few areas where they are extensively used is:
Banks
Universities
Airlines
E-Commerce
Stock Exchanges
Weather Forecast
Manufacturing Assemblies
Human Resource
1
www.Jntufastupdates.com 1
Database Management Systems Prof. B. Satyanarayana Reddy
DATABASE MANAGEMENT SYSTEM: The database management system with the help of application
programs, is able to address all the issues or problems of a file system. 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. As the volume of data and the number of users grow hundreds of gigabytes of data and
thousands of users are common in current corporate databases DBMS support becomes indispensable.
Data Independence: Application programs should not, ideally, be exposed to details of data
representation and storage, The DBMS provides an abstract view of the data that hides such details.
Efficient Data Access: A DBMS utilizes a variety of sophisticated techniques to store and retrieve data
efficiently. This feature is especially important if the data is stored on external storage devices.
Data Integrity and Security: If data is always accessed through the DBMS, the DBMS can enforce
integrity constraints. For example, before inserting salary information for an employee, the DBMS can
check that the department budget is not exceeded. Also, it can enforce access controls that govern what
data is visible to different classes of users.
Data Administration: Experienced professionals who understand the nature of the data being managed,
and how different groups of users use it, can be responsible 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.
Reasons for not choosing DBMS: Though there are several advantages with DBMS, some applications, with
tight real-time constraints or just a few well-defined critical operations for which efficient custom code must
be written are not choosing DBMS. The reasons are:
1. A DBMS is a complex piece of software, optimized for certain kinds of workloads and its performance
may not be adequate for certain specialized applications.
2. An application may need to manipulate the data in ways not supported by the query language. In such a
situation, the abstract view of the data presented by the DBMS does not match the application's needs
and actually gets in the way.
2
www.Jntufastupdates.com 2
Database Management Systems Prof. B. Satyanarayana Reddy
DATABASE USERS:
These apply to "large" databases, not "personal" databases that are defined, constructed, and used by a
single person like Microsoft Access. Users may be divided into 2 categories.
1. Actors on the scene
2. Workers behind the scene
ACTORS ON THE SCENE: Those who actually use and control the database content, and those who design,
develop and maintain database applications
1. Database Administrator (DBA): This is the chief administrator, who oversees and manages the
database system (including the data and software). Duties include authorizing users to access the database,
coordinating/monitoring its use, acquiring hardware/software for upgrades, etc. In large organizations, the
DBA might have a support staff.
2. Database Designers: They are responsible for identifying the data to be stored and for choosing an
appropriate way to organize it. They also define views for different categories of users. The final design
must be able to support the requirements of all the user sub-groups.
3. End Users: These are persons who access the database for querying, updating, and report
generation. They are main reason for database's existence.
Casual end users: use database occasionally, needing different information each time; use query
language to specify their requests; typically middle- or high-level managers.
Naive/Parametric end users: Typically the biggest group of users; frequently query/update the
database using standard canned transactions that have been carefully programmed and tested in
advance. Examples:
o bank tellers check account balances, post withdrawals/deposits.
o reservation clerks for airlines, hotels, etc., check availability of seats/rooms and make
reservations.
o shipping clerks (e.g., at UPS) who use buttons, bar code scanners, etc., to update status of in-
transit packages.
Sophisticated end users: engineers, scientists, business analysts who implement their own
applications to meet their complex needs.
Stand-alone users: Use "personal" databases, possibly employing a special-purpose (e.g.,
financial) software package. Mostly maintain personal databases using ready-to-use packaged
applications. An example is a tax program user that creates its own internal database. Another
example is maintaining an address book.
4. System Analysts, Application Programmers, Software Engineers:
System Analysts: determine needs of end users, especially naive and parametric users, and
develop specifications for canned transactions that meet these needs.
Application Programmers: Implement, test, document, and maintain programs that satisfy the
specifications mentioned above.
Software Engineers: Analysts and programmers are commonly referred to as software engineers-
should be familiar with the full range of capabilities provided by the DBMS to accomplish their
tasks.
3
www.Jntufastupdates.com 3
Database Management Systems Prof. B. Satyanarayana Reddy
WORKERS BEHIND THE SCENE: Those who design and develop the DBMS software and related tools,
and the computer systems operators.
1. DBMS system designers/ implementers: provide the DBMS software that is at the foundation of all.
2. Tool developers: design and implement software tools facilitating database system design, performance
monitoring, creation of graphical user interfaces, prototyping, etc.
3. Operators and maintenance personnel: responsible for the day-to-day operation of the system.
2. Restricting Unauthorized Access: A DBMS should provide a security and authorization subsystem, which
is used for specifying restrictions on user accounts. Common kinds of restrictions are to allow read-only access
(no updating), or access only to a subset of the data
3. Providing Persistent Storage for Program Objects: Object-oriented database systems make it easier for
complex runtime objects (e.g., lists, trees) to be saved in secondary storage so as to survive beyond program
termination and to be retrievable at a later time.
4. Providing Storage Structures for Efficient Query Processing: The DBMS maintains indexes (typically in
the form of trees and/or hash tables) that are utilized to improve the execution time of queries and updates. The
choice of which indexes to create and maintain is part of physical database design and tuning is the
responsibility of the DBA.
The query processing and optimization module is responsible for choosing an efficient query execution plan
for each query submitted to the system.
5. Providing Backup and Recovery: The subsystem having this responsibility ensures that recovery is possible
in the case of a system crash during execution of one or more transactions.
6. Providing Multiple User Interfaces: For example, query languages for casual users, programming language
interfaces for application programmers, forms and/or command codes for parametric users, menu-driven
interfaces for stand-alone users.
7. Representing Complex Relationships Among Data: A DBMS should have the capability to represent such
relationships and to retrieve related data quickly.
8. Enforcing Integrity Constraints: Most database applications are such that the of the data require that it
satisfy certain restrictions in order to make sense. Perhaps the most fundamental constraint on a data item is its
data type, which specifies the universe of values from which its value may be drawn.
Another kind of constraint is referential integrity, which says that if the database includes an entity that refers to
another one, the latter entity must exist in the database.
9. Permitting Inferencing and Actions Via Rules: In a deductive database system, one may specify
declarative rules that allow the database to infer new data. E.g., Figure out which students are on academic
probation. Such capabilities would take the place of application programs that would be used to ascertain such
information otherwise. Active database systems go one step further by allowing "active rules" that can be used
to initiate actions automatically.
4
www.Jntufastupdates.com 4
Database Management Systems Prof. B. Satyanarayana Reddy
DATABASE APPLICATIONS
1. Early Database Applications Using Hierarchical and Network Systems
Many early database applications, such as corporations, universities, hospitals, and banks. In many of these
applications, there were large numbers of records of similar structure. One of the main problems with early
database systems was the intermixing of conceptual relationships with the physical storage and placement of
records on disk.
Although this provided very efficient access for the original queries and transactions that the database was
designed to handle, it did not provide enough flexibility to access records efficiently when new queries and
transactions were identified. In particular, new queries that required a different storage organization for efficient
processing were quite difficult to implement efficiently. It was also quite difficult to reorganize the database
when changes were made to the requirements of the application. They provided only programming language
interfaces. This made it time-consuming and expensive to implement new queries and transactions, since new
programs had to be written, tested, and debugged.
5
www.Jntufastupdates.com 5
Database Management Systems Prof. B. Satyanarayana Reddy
• Storage and retrieval of images, from scanned news or personal photographs to satellite photograph
images and images from medical procedures such as X-rays or MRI (magnetic resonance imaging).
• Storage and retrieval of videos, such as movies, or video clips from news or personal digital cameras.
• Data mining applications that analyze large amounts of data searching for the occurrences of specific
patterns or relationships.
• Spatial applications that store spatial locations of data such as weather information or maps used in
geographical information systems.
• Time series applications that store information such as economic data at regular points in time, for
example, daily sales or monthly gross national product figures.
It was quickly apparent that basic relational systems were not very suitable for many of these applications,
usually for one or more of the reasons like need for more complex data structures, new data types, new
operations and query language constructs, new storage and indexing structures.
This led DBMS developers to add some general purpose and special purpose functionality to their systems.
1. OBJECT BASED LOGICAL MODELS: They are used in describing data at the logical and view levels.
They are characterized by the fact that they provide fairly flexible structuring capabilities and allow data
constraints to be specified explicitly. There are many different models mostly known ones are:
The E-R model
The object-oriented model
The semantic data model
The functional data model
The E-R model: The (E-R) data model is based on a perception of a real worker that consists of a collection of
basic objects, called entities, and of relationships among these objects. The overall logical structure of a
database can be expressed graphically by an E-R diagram. Which is built up by the following components:
Rectangles, which represent entity sets
Ellipses, which represent attributes
Diamonds, which represent relationships among entity sets
Lines, which link attributes to entity sets and entity sets to relationships
E.g. suppose we have two entities like customer and account, then these two entities can be modeled as follows.
6
www.Jntufastupdates.com 6
Database Management Systems Prof. B. Satyanarayana Reddy
7
www.Jntufastupdates.com 7
Database Management Systems Prof. B. Satyanarayana Reddy
Network Model:
Data in the network model is represented by collection of records, and relationship among data is represented by
links, which can be viewed as pointers. The records in the database are organized as collections of arbitrary
graphs.
Hierarchical Model:
The hierarchical model is similar to the network model in the sense that data and relationships among data are
represented by records and links, respectively. It differs from the network model in that records are organized as
collection of trees rather than arbitrary graphs.
8
www.Jntufastupdates.com 8
Database Management Systems Prof. B. Satyanarayana Reddy
Schema Diagram
The diagram displays the structure of each record type but not the actual instances of records. Each object in the
schema is known as schema construct.
9
www.Jntufastupdates.com 9
Database Management Systems Prof. B. Satyanarayana Reddy
A schema diagram displays only some aspects of a schema, such as the names of record types and data
items, and some types of constraints. Other aspects are not specified in the schema diagram. for example, It
shows neither the data type of each data item nor the relationships among the various files. Many types of
constraints are not represented in schema diagrams.
Database Instance: The data in the database at a particular moment in time is called a database state or
database instance or snapshot. It is also called the current set of occurrences or instances in the database. In a
given database state, each schema construct has its own current set of instances; for example, the STUDENT
construct will contain the set of individual student entities (records) as its instances. Many database states can
be constructed to correspond to a particular database schema. Every time we insert or delete a record or change
the value of a data item in a record, we change one state of the database into another state.
10
www.Jntufastupdates.com 10
Database Management Systems Prof. B. Satyanarayana Reddy
2. The conceptual level has a conceptual schema, which describes the structure of the whole database for a
community of users. The conceptual schema hides the details of physical storage structures and concentrates on
describing entities, data types, relationships, user operations, and constraints. Usually, a representational data
model is used to describe the conceptual schema when a database system is implemented. This implementation
conceptual schema is often based on a conceptual schema design in a high-level data model.
3. The external or view level includes a number of external schemas or user views. Each external schema
describes the part of the database that a particular user group is interested in and hides the rest of the database
from that user group. As in the previous case, each external schema is typically implemented using a
representational data model, possibly based on an external schema design in a high level data model.
11
www.Jntufastupdates.com 11
Database Management Systems Prof. B. Satyanarayana Reddy
DATA INDEPENDENCE:
Data independence can be defined as the capacity to change the schema at one level of a database
system without having to change the schema at the next higher level. We can define two types of data
independence:
1. Logical data independence is the capacity to change the conceptual schema without having to change
external schemas or application programs. We may change the conceptual schema to expand the database (by
adding a record type or data item), to change constraints, or to reduce the database (by removing a record type
or data item). After the conceptual schema undergoes a logical reorganization, application programs that
reference the external schema constructs must work as before. Changes to constraints can be applied to the
conceptual schema without affecting the external schemas or application programs.
2. Physical data independence is the capacity to change the internal schema without having to change the
conceptual schema. Hence, the external schemas need not be changed as well. Changes to the internal schema
may be needed because some physical files had to be reorganized-for example, by creating additional access
structures-to improve the performance of retrieval or update. If the same data as before remains in the database,
we should not have to change the conceptual schema.
Data independence occurs because when the schema is changed at some level, the schema at the next
higher level remains unchanged; only the mapping between the two levels is changed. Hence, application
programs referring to the higher-level schema need not be changed. The three-schema architecture can make it
easier to achieve true data independence, both physical and logical.
12
www.Jntufastupdates.com 12
Database Management Systems Prof. B. Satyanarayana Reddy
In addition, several data structures are required for physical system implementation:
a. Data files: They store the database itself.
b. Data dictionary: It stores information about the structure of the database. It is used heavily. Great emphasis
should be placed on developing a good design and efficient implementation of the dictionary. In short, it stores
metadata.
c. Indices: They provide fast access to data items holding particular values.
13
www.Jntufastupdates.com 13
Database Management Systems Prof. B. Satyanarayana Reddy
DATABASE ENVIRONMENT
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 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.
14
www.Jntufastupdates.com 14
Database Management Systems Prof. B. Satyanarayana Reddy
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.
15
www.Jntufastupdates.com 15
Database Management Systems Prof. B. Satyanarayana Reddy
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.
16
www.Jntufastupdates.com 16
Database Management Systems Prof. B. Satyanarayana Reddy
17
www.Jntufastupdates.com 17