0% found this document useful (0 votes)
14 views19 pages

DBMS Unit-1(Part-1)

Uploaded by

syedtasleem07
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
Download as docx, pdf, or txt
0% found this document useful (0 votes)
14 views19 pages

DBMS Unit-1(Part-1)

Uploaded by

syedtasleem07
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1/ 19

DATABASE MANAGEMENT SYSTEMS UNIT – I : INTRODUCTION

DATABASE MANAGEMENT SYSTEMS


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.
Entity Relationship Model: Introduction, Representation of entities, attributes, entity
set,
relationship, relationship set, constraints, sub classes, super class, inheritance,
specialization, generalization using ER Diagrams.

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.

1.1 Database Management Systems (DBMS)

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.
DATABASE MANAGEMENT SYSTEMS UNIT – I : INTRODUCTION
Example: A Bank, a Hospital, a University, a Manufacturing company

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.

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.2 Database System Applications

Databases are widely used. Here are some representative applications:


1. Banking: For customer information, accounts, and loans, and banking transactions.
2. Airlines: For reservations and schedule information. Airlines were among
the first to use databases in a geographically distributed manner - terminals
situated around the world accessed the central database system through
phone lines and other data networks.
3. Universities: For student information, course registrations, and grades.
4. Credit card transactions: For purchases on credit cards and generation of
monthly statements.
5. Telecommunication: For keeping records of calls made, generating
monthly bills, maintaining balances on prepaid calling cards, and
DATABASE MANAGEMENT SYSTEMS UNIT – I : INTRODUCTION
storing information about the communication networks.
6. Finance: For storing information about holdings, sales, and purchases of
financial instruments such as stocks and bonds.
7. Sales: For customer, product, and purchase information.
8. Manufacturing: For management of supply chain and for tracking
production of items in factories, inventories of items in warehouses /
stores, and orders for items.
9. Human resources: For information about employees, salaries, payroll
taxes and benefits, and for generation of paychecks.

1.3 File Systems Versus A DBMS (Characteristics)


In earlier days, the databases were created directly on top of file systems. File
system has many disadvantages.

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.
DATABASE MANAGEMENT SYSTEMS UNIT – I : INTRODUCTION

1.4 Advantages of DBMS

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.
Controlled Data redundancy and inconsistency:
In a file processing system, each user group maintains its own files this results data
redundancy. In database approach all data of an organization is integrated into a
single database file. The data can be stored at a single place. This controls
duplication of data and data inconsistency.

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: 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.

Sharing of Data:
A DBMS allows the sharing of database under its control by any number of
application programs or users. A database belongs to the entire organization and is
shared by all authorized 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. .

Reduced application development time: Clearly, the DBMS supports


many important functions that are common to many applications accessing
data stored in the DBMS.

1.5 Disadvantages of DBMS

The disadvantage of the DBMS system is overhead cost. The processing


DATABASE MANAGEMENT SYSTEMS UNIT – I : INTRODUCTION
overhead introduced by the DBMS to implement security, integrity, and
sharing of the data causes a degradation of the response and throughput
times. An additional cost is that of migration from a traditionally separate
application environment to an integrated one.

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.

1.6 Data Model:

A data model is a collection of concepts that can be used to describe the logical structure
of a database. The structure of a database means that holds the data’s data types,
relationships, and constraints.
The most common data models are

1. Hierarchical model
2. Network Data model
3. Relational Data model
4. Entity-Relationship model
5. Object -oriented database model:

1). Hierarchical model:

1. Hierarchical database model is one of the oldest database models, It was


developed in 1966 based on Information Management System (IMS).
2. Basic logical structure is represented by an upside-down “tree”. the origin of data
tree is the root.
3. A node represents a particular entity. Data storage is in the form of a parent–child
relationship.
4. A node may have any number of children, but each child node may have only
one parent. Data storage is in the form of a parent–child relationship. The last
node in the series is called the leaf.
5. This model supports one-to-many relationship among entities.
6. The nodes of the tree represent data records. To locate a particular record in a
hierarchical database, you have to start at the top of the tree and trace down the
tree.

Advantages
DATABASE MANAGEMENT SYSTEMS UNIT – I : INTRODUCTION
1. It promotes data sharing.
2. Parent/child relationship promotes simplicity and data integrity.
3. It is efficient with one to many(1:M) relationships.

Fig. Hierarchical method, the very first database design model

Disadvantages

1. It is not possible to enter a new level into system.Another


disadvantage is that this model does not support many-to-many
(M:M) relationship.
2. In case this of relation is required then multiple copies of the same data
have to make which result in redundancy.

2). Network Data model:

1. The network model's original inventor was Charles Bachman, and it was
developed into a standard specification published in 1969 by the Conference on
Data Systems Languages (CODASYL).
2. The main idea behind the Network Data Model is to bring about many-to-many
relationship.
3. There is no distinction between parent and child nodes. A child node can have
more than one parent node.
4. This system also uses a pointer to locate particular records.
5. Created to represent complex data relationships more effectively, It Improve
database performance.
6. In this model directed Graphs are used instead of tree structure to represent the
structure of the database.
.

Advantages
DATABASE MANAGEMENT SYSTEMS UNIT – I : INTRODUCTION
1. It handles the more relationship types, such as M: M.
2. Data access is more flexible than hierarchical model.
3. It includes DDL and DML commands in DBMS.
4. Data owner/member relationship promotes data integrity.

Fig. Network model example

Disadvantages

1. System complexity- All the records are maintained using pointers and hence the

whole database structure becomes very complex.


Operational Anomalies- The insertion, deletion and updating operations of any record
require large number of pointers adjustments.
3). Relational Data model:

 The relational data model was introduced by E.F.Codd in 1970. The relational
data model is implemented through a relational database management system.
 In relational model, data is organized in terms of rows and columns in a
table known as relation. Rows are called tuples and columns are called as
attributes.
 The relational database connects data in different tables through attributes.
 No data redundancy, No physical links relations are maintaining logically. Support
null values and integrity constrains.
 Provides high security and supports to store any data types.
 Data can be stored among several users at time, Data can also be shared
across several forms.

Advantages
DATABASE MANAGEMENT SYSTEMS UNIT – I : INTRODUCTION
1. We can create complex and efficient data structures.
2. Query capability is based on SQL.

Disadvantages:
1. The RDBMS requires substantial hardware and software overhead.
2. It is expensive to set up and maintain the database.

4). Entity-Relationship Model :

The ER data model is based on a perception of a real world that consists of a collection of
basic objects, called entities, and of relationships among these objects.
Entity: A real world object
E.g. customers, accounts, bank branch
Relationship: An association between entities
E.g. works-for, managers
Attribute: Property of the Entity.
E.g. empno, ename, sal
Database design in E-R model usually converted to design in the relational model,
which is used for storage, and processing. The overall logical structure (schema) of a
database can be expressed graphically by an E-R diagram, which is built up from 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 Each component is labeled with the entity or
relationship that it represents.
DATABASE MANAGEMENT SYSTEMS UNIT – I : INTRODUCTION

Advantages:
1. Visual representation makes it an effective communication tool.
2. It is with domain relational model.

disadvantages:
1. There is limited constraint representation.
2. There is limited relationship representation.
3. There is no data manipulation language.

5.Object - Oriented database model:

The object-oriented data model is an adaptation of the object oriented programming


language paradigm to database systems. The model is based on the concept of
encapsulating data and code that operates on that data in an object.

 Entities in the sense of the ER model are represented as objects with


attribute values represented by instance variables within the object.
 An object may send a message to another object causing that object to execute a
method in response Methods are procedures written in a general purpose
programming language .

 Objects that share similar characteristics are grouped in classes. A class is a


collection of similar objects with shared structure (attributes) and behavior
(methods).

 Classes are organized in a class hierarchy. The class hierarchy resembles an


upside-down tree in which each class has only one parent.

 Inheritance is the ability of an object within the class hierarchy to inherit the
attributes and methods of the classes above it.

OBJECT DIAGRAM OF A STUDENT.

Advantages:
 Semantic content is added. STUDENT
 Inheritance promotes data integrity.
 Visual representation includes semantic content.
SNO : NUMBER
SNAME : STRING
AGE : NUMBER
DATABASE MANAGEMENT SYSTEMS UNIT – I : INTRODUCTION
Disadvantages:
 Slow development of standards
caused vendors to supply their own
enhancement.
 It is complex navigational system.
 It has slow transaction in high systems.
1.7 Levels of Abstraction in a DBMS (Three tier schema architecture)
The data in a DBMS is described at three levels of abstraction.
The database description consists of a schema at each of these three levels of
abstraction.
External, Conceptual and
Physical Views describe how users
see the data. Conceptual schema
defines logical structure.
Physical schema describes the files and indexes used.

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)
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:

 The physical schema specifies storage details.


 It summarizes how the relations described in the conceptual schema are
actually stored on secondary storage devices such as disks and tapes.
 Decides what file organizations to use to store the relations and
create auxiliary data structures, called indexes, to speed up data retrieval
operations.
 A sample physical schema for the university database is to store all
relations as unsorted files of records.
o Create indexes on the first column of the students, faculty and
courses relations, the salary column of faculty, and the capacity of
column of rooms.

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.

1.8 Data Independence


Application programs are insulated from changes in the way the data is
structured and stored. Data independence is achieved through use of the three
levels of data abstraction.
Logical data independence: users can be shielded from changes in the logical
structure of the data, or changes in the choice of relations to be stored. This is the
independence to change the conceptual schema without having to change the
external schemas and their application programs.
Physical data independence: the conceptual schema insulated users from
changes in physical storage details. This is the independence to change the
internal schema without having to change the conceptual schema.
1.9 Architecture of a DBMS
The functional components of a database system can be broadly divided into
DATABASE MANAGEMENT SYSTEMS UNIT – I : INTRODUCTION
query processor components and storage manager components. The query
processor includes:
1. DML Compiler: It translates DML statements in a query language into low-level
instructions that the query evaluation engine understands.
2. Embedded DML Pre-compiler: It converts DML statements embedded in
an application program to normal procedure calls in the host language. The
pre-compiler must interact with the DML compiler to generate the
appropriate code.
3. DDL Interpreter: It interprets DDL Stateline its and records them in a set of tables
containing metadata.
4.Transacction 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 it.
DATABASE MANAGEMENT SYSTEMS UNIT – I : INTRODUCTION
1.10 People Who Deal With Databases
Quite a variety of people are associated with the creation and use of
databases. Obviously, there are database implementors, who build DBMS
software, and end users who wish to store and use data in a DBMS.

i. System administrators: They supervise the database system's general operations.

ii. Database administrators: They are also known as DBAs. They manage the DBMS and
ensure that the database is functioning properly.

iii. Database designers: They design the database structure. They are the database
architects. As this is very critical, the designer's job responsibilities are increased.

iv. Systems analysts and programmers: They design and implement the application
programs. They design and create the data entry screens, reports, and procedures
through which end users can access and manipulate the data.

v. End users: They are the people who use the application programs to run the
organization's daily operations. For example, sales-clerks, supervisors, managers are
classified as end users.

The DBA is responsible for many critical tasks:

 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.

1 . 1 1 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.
DATABASE MANAGEMENT SYSTEMS UNIT – I : INTRODUCTION
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.

1.12 Database Architecture


Database architecture uses programming languages to design a particular type
of software for businesses or organizations. Database architecture focuses on
the design, development, implementation and maintenance of computer
programs that store and organize information for businesses, agencies and
DATABASE MANAGEMENT SYSTEMS UNIT – I : INTRODUCTION
institutions.

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

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.

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.
DATABASE MANAGEMENT SYSTEMS UNIT – I : INTRODUCTION

1.13 Centralized DBMS Architecture


Architectures for DBMSs have followed trends similar to those for general
computer system architectures. Earlier architectures used mainframe computers
to provide the main processing for all functions of the system, including user
application programs and user interface programs, as well as all the DBMS
functionality.

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.

1.14 Client/Server Architecture:


The client/server architecture was developed to deal with computing
DATABASE MANAGEMENT SYSTEMS UNIT – I : INTRODUCTION
environments in which a large number of PCs, workstations, file servers,
printers, database servers, Web servers, and other equipment are connected via
a network. The idea is to define specialized servers with specific functionalities.

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.

The concept of client/server architecture assumes an underlying framework


that consists of many PCs and workstations as well as a smaller number of
mainframe machines, connected via local area networks and other types of
computer networks. A client in this framework is typically a user machine that
provides user interface capabilities and local processing. When a client
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.
DATABASE MANAGEMENT SYSTEMS UNIT – I : INTRODUCTION
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.

3.1 Introduction

The entity-relationship (ER) data model allows us to describe the data


involved in a real-world enterprise in terms of objects and their
relationships and is widely used to develop an initial database design.
The ER model is important primarily for its role in database design. It
provides useful concepts that allow us to move from an informal
description of what users want from their database to a more detailed
and precise, description that can be implemented in a DBMS.
Even though the ER model describes the physical database model, it is
basically useful in the design and communication of the logical
database model.
DATABASE MANAGEMENT SYSTEMS UNIT – I : INTRODUCTION

You might also like