0% found this document useful (0 votes)
12 views

DBMS Unit_1_notes

Uploaded by

Mitali Mathur
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
12 views

DBMS Unit_1_notes

Uploaded by

Mitali Mathur
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 21

Neetu Bansla DBMS 18CSC303J

Unit-1
Topics covered: Overview of DBMS, Advantages of DBMS over a file processing system,
Introduction & applications of DBMS, Purpose of database system, Views of data, Database
system architecture, Data independence, Evolution of data models, Degree of data abstraction,
Database users & DBA, Database languages .

1. Overview of DBMS

What is a Database?

The database is a collection of inter-related data which is used to retrieve, insert and delete
the data efficiently. It is also used to organize the data in the form of a table, schema, views,
and reports, etc.

For example: The college Database organizes the data about the admin, staff, students and
faculty etc.

Using the database, you can easily retrieve, insert, and delete the information.

What is RDBMS?

RDBMS stands for Relational Database Management Systems.

• All modern database management systems like SQL, MS SQL Server, IBM DB2,
ORACLE, My-SQL and Microsoft Access are based on RDBMS.
• It is called Relational Data Base Management System (RDBMS) because it is based on
relational model introduced by E.F. Codd.
• Data is represented in terms of tuples (rows) in RDBMS.
• Relational database is most commonly used database. It contains number of tables
and each table has its own primary key.
• Due to a collection of organized set of tables, data can be accessed easily in RDBMS.
• During 1970 to 1972, E.F. Codd published a paper to propose the use of relational
database model.
• RDBMS is originally based on that E.F. Codd's relational model invention.
• The RDBMS database uses tables to store data. A table is a collection of related data
entries and contains rows and columns to store data.
• A table is the simplest example of data storage in RDBMS.

Let's see the example of student table.

1
Neetu Bansla DBMS 18CSC303J

ID Name AGE COURSE

1 Ajeet 24 B.Tech

2 aryan 20 C.A

3 Mahesh 21 BCA

4 Ratan 22 MCA

5 Vimal 26 BSC

Database Management System


o Database management system is software which is used to manage the database. For
example: MySQL, Oracle, etc are a very popular commercial database which is used in
different applications.
o DBMS provides an interface to perform various operations like database creation,
storing data in it, updating data, creating a table in the database and a lot more.
o It provides protection and security to the database. In the case of multiple users, it
also maintains data consistency.

DBMS allows users the following tasks:

o Data Definition: It is used for creation, modification, and removal of definition that
defines the organization of data in the database.
o Data Updation: It is used for the insertion, modification, and deletion of the actual
data in the database.
o Data Retrieval: It is used to retrieve the data from the database which can be used
by applications for various purposes.
o User Administration: It is used for registering and monitoring users, maintaining
data integrity, enforcing data security, dealing with concurrency control, monitoring
performance and recovering information corrupted by unexpected failure.

Characteristics of DBMS
o It uses a digital repository established on a server to store and manage the
information.

2
Neetu Bansla DBMS 18CSC303J

o It can provide a clear and logical view of the process that manipulates data.
o DBMS contains automatic backup and recovery procedures.
o It contains ACID properties which maintain data in a healthy state in case of failure.
o It can reduce the complex relationship between data.
o It is used to support manipulation and processing of data.
o It is used to provide security of data.
o It can view the database from different viewpoints according to the requirements of
the user.

Advantages of DBMS
o Controls database redundancy: It can control data redundancy because it stores all
the data in one single database file and that recorded data is placed in the database.
o Data sharing: In DBMS, the authorized users of an organization can share the data
among multiple users.
o Easily Maintenance: It can be easily maintainable due to the centralized nature of
the database system.
o Reduce time: It reduces development time and maintenance need.
o Backup: It provides backup and recovery subsystems which create automatic backup
of data from hardware and software failures and restores the data if required.
o multiple user interface: It provides different types of user interfaces like graphical
user interfaces, application program interfaces

2. DBMS vs. File System

File System Approach

File based systems were an early attempt to computerize the manual system. It is also called
a traditional based approach in which a decentralized approach was taken where each
department stored and controlled its own data with the help of a data processing specialist.
The main role of a data processing specialist was to create the necessary computer file
structures, and also manage the data within structures and design some application
programs that create reports based on file data.

3
Neetu Bansla DBMS 18CSC303J

In the above figure:

Consider an example of a student's file system. The student file will contain information
regarding the student (i.e. roll no, student name, course etc.). Similarly, we have a subject file
that contains information about the subject and the result file which contains the
information regarding the result.

Some fields are duplicated in more than one file, which leads to data redundancy. So to
overcome this problem, we need to create a centralized system, i.e. DBMS approach.

DBMS:

A database approach is a well-organized collection of data that are related in a meaningful


way which can be accessed by different users but stored only once in a system. The various
operations performed by the DBMS system are: Insertion, deletion, selection, sorting etc.

4
Neetu Bansla DBMS 18CSC303J

In the above figure,

In the above figure, duplication of data is reduced due to centralization of data.

There are the following differences between DBMS and File systems:

Basis DBMS Approach File System Approach

Meaning DBMS is a collection of data. In DBMS, the The file system is a collection of data. In
user is not required to write the this system, the user has to write the
procedures. procedures for managing the database.

Sharing of data Due to the centralized approach, data Data is distributed in many files, and it
sharing is easy. may be of different formats, so it isn't
easy to share data.

Data Abstraction DBMS gives an abstract view of data that The file system provides the detail of the
hides the details. data representation and storage of data.

5
Neetu Bansla DBMS 18CSC303J

Security and DBMS provides a good protection It isn't easy to protect a file under the file
Protection mechanism. system.

Recovery DBMS provides a crash recovery The file system doesn't have a crash
Mechanism mechanism, i.e., DBMS protects the user mechanism, i.e., if the system crashes
from system failure. while entering some data, then the
content of the file will be lost.

Manipulation DBMS contains a wide variety of The file system can't efficiently store and
Techniques sophisticated techniques to store and retrieve the data.
retrieve the data.

Concurrency DBMS takes care of Concurrent access of In the File system, concurrent access has
Problems data using some form of locking. many problems like redirecting the file
while deleting some information or
updating some information.

Where to use Database approach used in large systems File system approach used in large
that interrelates many files. systems that interrelates many files.

Cost The database system is expensive to The file system approach is cheaper to
design. design.

Data Redundancy Due to the centralization of the database, In this, the files and application
and Inconsistency the problems of data redundancy and programs are created by different
inconsistency are controlled. programmers therefore there exists a lot
of duplication of data which may lead to
inconsistency.

Structure The database structure is complex to The file system approach has a simple
design. structure.

Data In this system, Data Independence exists, In the File system approach, there exists
Independence and it can be of two types. no Data Independence.

6
Neetu Bansla DBMS 18CSC303J

o Logical Data Independence


o Physical Data Independence

Integrity Integrity Constraints are easy to apply. Integrity Constraints are difficult to
Constraints implement in file system.

Flexibility Changes are often a necessity to the The flexibility of the system is less as
content of the data stored in any system, compared to the DBMS approach.
and these changes are more easily with a
database approach.

3. Application of DBMS
There are different fields where a database management system is utilized. Following are
a few applications which utilize the information base administration framework –

1. Railway Reservation System –


In the rail route reservation framework, the information base is needed to store the
record or information of ticket appointments, status about train’s appearance, and
flight. Additionally, if trains get late, individuals become acquainted with it through
the information base update.

2. Library Management System –


There are loads of books in the library so; it is difficult to store the record of the
relative multitude of books in a register or duplicate. Along these lines, the data set
administration framework (DBMS) is utilized to keep up all the data identified with
the name of the book, issue date, accessibility of the book, and its writer.

3. Banking –
Database the executive’s framework is utilized to store the exchange data of the client
in the information base.

4. Education Sector –
Presently, assessments are led online by numerous schools and colleges. They deal
with all assessment information through the data set administration framework

7
Neetu Bansla DBMS 18CSC303J

(DBMS). In spite of that understudy’s enlistments subtleties, grades, courses, expense,


participation, results, and so forth all the data is put away in the information base.

5. Credit card exchanges –


The database Management framework is utilized for buying on charge cards and age
of month to month proclamations.

6. Social Media Sites –


We all utilization of online media sites to associate with companions and to impart
our perspectives to the world. Every day, many people group pursue these online
media accounts like Pinterest, Facebook, Twitter, and Google in addition to. By the
utilization of the data set administration framework, all the data of clients are put
away in the information base and, we become ready to interface with others.

7. Broadcast communications –
Without DBMS any media transmission organization can’t think. The Database the
executive’s framework is fundamental for these organizations to store the call
subtleties and month to month postpaid bills in the information base.

8. Account –
The information base administration framework is utilized for putting away data about
deals, holding and acquisition of monetary instruments, for example, stocks and bonds
in a data set.

9. Online Shopping –
These days, web-based shopping has become a major pattern. Nobody needs to visit
the shop and burn through their time. Everybody needs to shop through web based
shopping sites, (for example, Amazon, Flipkart, Snapdeal) from home. So all the items
are sold and added uniquely with the assistance of the information base
administration framework (DBMS). Receipt charges, installments, buy data these are
finished with the assistance of DBMS.

10. Human Resource Management –


Big firms or organizations have numerous specialists or representatives working
under them. They store data about worker’s compensation, assessment, and work
with the assistance of an information base administration framework (DBMS).

8
Neetu Bansla DBMS 18CSC303J

11. Manufacturing –
Manufacturing organizations make various kinds of items and deal them consistently.
To keep the data about their items like bills, acquisition of the item, amount, inventory
network the executives, information base administration framework (DBMS) is
utilized.

12. Airline Reservation System –


This framework is equivalent to the railroad reservation framework. This framework
additionally utilizes an information base administration framework to store the
records of flight takeoff, appearance, and defer status.

4. Purpose of a Database system

The purpose of DBMS is to transform the following −

• Data into information.

• Information into knowledge.

• Knowledge to the action.

The diagram given below explains the process as to how the transformation of data to
information to knowledge to action happens respectively in the DBMS −

9
Neetu Bansla DBMS 18CSC303J

5. Various Views of Data


It refers that how database is actually stored in database, what data and structure of data
used by database for data. So describe all this database provides user with views and these
are

• Data abstraction
• Instances and schemas.

Data abstraction

As a data in database are stored with very complex data structure so when user come and
want to access any data, he will not be able to access data if he has go through this data
structure. So to simplify the interaction of user and database, DBMS hides some
information which is not of user interest, a this is called data abstraction:- So developer
hides complexity from user and store abstract view of data.

Data abstraction has three levels of abstractions

• Physical level / internal level: this is the lowest level of data abstraction which
describes how data is actually stored in database? This level basically describes the
data structure and access path /indexing use for accessing file.
• Logical level / conceptual level: The next level of abstraction describe what data
are stored in the database and what are the relationship existed among those of
data.
• View level / external level: In this level user only interact with database and the
complexity remain unviewed. User sees data and there may be many views of one
data like chart and graph.

6. Database system Architecture

• The DBMS design depends upon its architecture. The basic client/server
architecture is used to deal with a large number of PCs, web servers, database
servers and other components that are connected with networks.
• The client/server architecture consists of many PCs and a workstation which are
connected via the network.
• DBMS architecture depends upon how users are connected to the database to get
their request done.

10
Neetu Bansla DBMS 18CSC303J

Types of DBMS Architecture

Database architecture can be seen as a single tier or multi-tier. But logically, database
architecture is of two types like: 2-tier architecture and 3-tier architecture.

1-Tier Architecture
o In this architecture, the database is directly available to the user. It means the user
can directly sit on the DBMS and uses it.
o Any changes done here will directly be done on the database itself. It doesn't provide
a handy tool for end users.
o The 1-Tier architecture is used for development of the local application, where
programmers can directly communicate with the database for the quick response.

2-Tier Architecture
o The 2-Tier architecture is same as basic client-server. In the two-tier architecture,
applications on the client end can directly communicate with the database at the
server side. For this interaction, API's like: ODBC, JDBC are used.
o The user interfaces and application programs are run on the client-side.
o The server side is responsible to provide the functionalities like: query processing
and transaction management.
o To communicate with the DBMS, client-side application establishes a connection with
the server side.

11
Neetu Bansla DBMS 18CSC303J

3-Tier Architecture
o The 3-Tier architecture contains another layer between the client and server. In this
architecture, client can't directly communicate with the server.
o The application on the client-end interacts with an application server which further
communicates with the database system.
o End user has no idea about the existence of the database beyond the application
server. The database also has no idea about any other user beyond the application.
o The 3-Tier architecture is used in case of large web application.

12
Neetu Bansla DBMS 18CSC303J

7. Data Independence

o Data independence can be explained using the three-schema architecture.


o Data independence refers characteristic of being able to modify the schema at one
level of the database system without altering the schema at the next higher level.

There are two types of data independence:

1. Logical Data Independence


o Logical data independence refers characteristic of being able to change the
conceptual schema without having to change the external schema.
o Logical data independence is used to separate the external level from the conceptual
view.
o If we do any changes in the conceptual view of the data, then the user view of the
data would not be affected.
o Logical data independence occurs at the user interface level.

2. Physical Data Independence


o Physical data independence can be defined as the capacity to change the internal
schema without having to change the conceptual schema.
o If we do any changes in the storage size of the database system server, then the
Conceptual structure of the database will not be affected.
o Physical data independence is used to separate conceptual levels from the internal
levels.
o Physical data independence occurs at the logical interface level.

13
Neetu Bansla DBMS 18CSC303J

8. Evolution of Data Modals

Managing data was the key and was essential. Therefore, data model originated to solve
the file system issues. Here are the Data Models in DBMS −

Hierarchical Model
• In Hierarchical Model, a hierarchical relation is formed by collection of relations
and forms a tree-like structure.

• The relationship can be defined in the form of parent child type.

• One of the first and most popular Hierarchical Model is Information Management
System (IMS), developed by IBM.

Example: The hierarchy shows an Employee can be an Intern, on Contract or Full- Time.
Sub-levels show that Full-Time Employee can be hired as a Writer, Senior Writer or
Editor:

Advantages

• The design of the hierarchical model is simple.


• Provides Data Integrity since it is based on parent/ child relationship
• Data sharing is feasible since the data is stored in a single database.
• Even for large volumes of data, this model works perfectly.
Disadvantages

• Implementation is complex.
• This model has to deal with anomalies like Insert, Update and Delete.
• Maintenance is difficult since changes done in the database may want you to do
changes in the entire database structure.

14
Neetu Bansla DBMS 18CSC303J

Network Model
• The Hierarchical Model creates hierarchical tree with parent/ child relationship,
whereas the Network Model has graph and links.

• The relationship can be defined in the form of links and it handles many-to-many
relations. It itself states that a record can have more than one parent.

Example

Advantages

• Easy to design the Network Model


• The model can handle one-one, one-to-many, many-to-many relationships.
• It isolates the program from other details.
• Based on standards and conventions.
Disadvantages

• Pointers bring complexity since the records are based on pointers and graphs.
• Changes in the database are not easy, that makes it hard to achieve structural
independence.

Relational Model
• A relational model groups data into one or more tables. These tables are related to
each other using common records.

15
Neetu Bansla DBMS 18CSC303J

• The data is represented in the form of rows and columns i.e. tables:

Example

Let us see an example of two relations <Employee> and <Department> linked to each
other, with DepartmentID, which is Foreign Key of <Employee> table and Primary key
of <Department> table.

Advantages

• The Relational Model does not have any issues that we saw in the previous two
models i.e. update, insert and delete anomalies have nothing to do in this model.
• Changes in the database do not require you to affect the complete database.
• Implementation of a Relational Model is easy.
• To maintain a Relational Model is not a tiresome task.

16
Neetu Bansla DBMS 18CSC303J

Disadvantages

• Database inefficiencies hide and arise when the model has large volumes of data.
• The overheads of using relational data model come with the cost of using powerful
hardware and devices.

9. Degrees of Data Abstraction

There are mainly 3 levels of data abstraction:


• Physical: This is the lowest level of data abstraction. It tells us how the data is
actually stored in memory. The access methods like sequential or random
access and file organization methods like B+ trees, hashing used for the same.
Usability, size of memory, and the number of times the records are factors that
we need to know while designing the database. Suppose we need to store the
details of an employee. Blocks of storage and the amount of memory used for
these purposes are kept hidden from the user.
• Logical: This level comprises the information that is actually stored in the
database in the form of tables. It also stores the relationship among the data
entities in relatively simple structures. At this level, the information available
to the user at the view level is unknown. We can store the various attributes of
an employee and relationships, e.g. with the manager can also be stored.
• View: This is the highest level of abstraction. Only a part of the actual database
is viewed by the users. This level exists to ease the accessibility of the database
by an individual user. Users view data in the form of rows and columns. Tables
and relations are used to store data. Multiple views of the same database may
exist. Users can just view the data and interact with the database, storage and
implementation details are hidden from them.

17
Neetu Bansla DBMS 18CSC303J

The main purpose of data abstraction is to achieve data independence in order to save time
and cost required when the database is modified or altered.
10. Database Users & Database Administrator (DBA)
Database users are categorized based up on their interaction with the data base.
These are seven types of data base users in DBMS.
Database Administrator (DBA):-
Database Administrator (DBA) is a person/team who defines the schema and also
controls the 3 levels of database. The DBA will then create a new account id and
password for the user if he/she needs to access the data base.DBA is also responsible
for providing security to the data base and he allows only the authorized users to
access/modify the data base.DBA also monitors the recovery and back up and provide
technical support. The DBA has a DBA account in the DBMS which called a system or
super user account.DBA repairs damage caused due to hardware and/or software
failures.
Naive / Parametric End Users :
Parametric End Users are the unsophisticated who don’t have any DBMS knowledge
but they frequently use the data base applications in their daily life to get the desired
results.

18
Neetu Bansla DBMS 18CSC303J

For examples, Railway’s ticket booking users are naive users. Clerk in any bank is a naive
user because they don’t have any DBMS knowledge but they still use the database and
perform their given task.

System Analyst:
System Analyst is a user who analyzes the requirements of parametric end users. They
check whether all the requirements of end users are satisfied.

Sophisticated Users:
Sophisticated users can be engineers, scientists, business analyst, who are familiar with
the database. They can develop their own data base applications according to their
requirement. They don’t write the program code but they interacts the data base by
writing SQL queries directly through the query processor.

Data Base Designers:


Data Base Designers are the users who design the structure of data base which includes
tables, indexes, views, constraints, triggers, stored procedures. He/she controls what data
must be stored and how the data items to be related.

Application Programmers:
Application Program is the back end programmers who write the code for the application
programs. They are the computer professionals. These programs could be written in
Programming languages such as Visual Basic, Developer, C, FORTRAN, COBOL etc.

11. Database Languages


o A DBMS has appropriate languages and interfaces to express database queries and
updates.
o Database languages can be used to read, store and update the data in the database.

19
Neetu Bansla DBMS 18CSC303J

Types of Database Language

1. Data Definition Language


o DDL stands for Data Definition Language. It is used to define database structure or
pattern.
o It is used to create schema, tables, indexes, constraints, etc. in the database.
o Using the DDL statements, you can create the skeleton of the database.
o Data definition language is used to store the information of metadata like the number
of tables and schemas, their names, indexes, columns in each table, constraints, etc.

Here are some tasks that come under DDL:

o Create: It is used to create objects in the database.


o Alter: It is used to alter the structure of the database.
o Drop: It is used to delete objects from the database.
o Truncate: It is used to remove all records from a table.
o Rename: It is used to rename an object.
o Comment: It is used to comment on the data dictionary.

These commands are used to update the database schema that's why they come under Data
definition language.

2. Data Manipulation Language

DML stands for Data Manipulation Language. It is used for accessing and manipulating data
in a database. It handles user requests.

20
Neetu Bansla DBMS 18CSC303J

Here are some tasks that come under DML:

o Select: It is used to retrieve data from a database.


o Insert: It is used to insert data into a table.
o Update: It is used to update existing data within a table.
o Delete: It is used to delete all records from a table.
o Merge: It performs UPSERT operation, i.e., insert or update operations.
o Call: It is used to call a structured query language or a Java subprogram.
o Explain Plan: It has the parameter of explaining data.
o Lock Table: It controls concurrency.

3. Data Control Language


o DCL stands for Data Control Language. It is used to retrieve the stored or saved data.
o The DCL execution is transactional. It also has rollback parameters.

(But in Oracle database, the execution of data control language does not have the
feature of rolling back.)

Here are some tasks that come under DCL:

o Grant: It is used to give user access privileges to a database.


o Revoke: It is used to take back permissions from the user.

There are the following operations which have the authorization of Revoke:

CONNECT, INSERT, USAGE, EXECUTE, DELETE, UPDATE and SELECT.

4. Transaction Control Language

TCL is used to run the changes made by the DML statement. TCL can be grouped into a logical
transaction.

Here are some tasks that come under TCL:

o Commit: It is used to save the transaction on the database.


o Rollback: It is used to restore the database to original since the last Commit.

21

You might also like