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

Database Management System(DBMS)

Database notes

Uploaded by

shrshniazi
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
5 views

Database Management System(DBMS)

Database notes

Uploaded by

shrshniazi
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 21

What is a DBMS

 DBMS is a software that handles the storage, retrieval,


and updating of data in a computer system. It serves as
an interface between the end user and the database.
 Database systems are basically developed for large
amount of data, there are two things that require
optimization:
1. Storage of data
2. Retrieval of data
Applications of DBMS
 Telecom
 Industry
 Banking system
 Sales
 Airlines
 Education sector
 Online shopping
Advantages of DBMS
 No redundant data
 Data consistency and Integrity
 Data security
 Privacy
 Easy access to data
 Easy Recovery
 Flexible
Types of DBMS architecture
 There are three types of DBMS architecture
1. Single Tier architecture: In this type of
architecture, the database is readily available on
client machine, any request made by client doesn’t
require a network connection. For Example, you
want to access employees data from a database and
that database is located on your computer. You don’t
require network connection to access that data. This
type of DBMS is called Local data base.
Two Tier architecture
 Two Tier architecture: In two tier architecture, the
database system is located at the server machine
and the DBMS application is present at client
machine, these two machines are connected with
each other through a reliable network as shown in
diagram
Two Tier architecture
Client Machine
DATABASE USER

DBMS
APPLICATION

Network connection

Server Machine
DATABASE SYSTEM
Three Tier architecture
 Three Tier architecture: In three tier architecture,
another layer is present between client machine and
server machine, the client application doesn’t directly
communicate with database system present at the
server machine, rather client application communicate
with server application and the server application
internally communicate with the database present at
the server.
Three Tier architecture
Client machine
DATABASE USER

CLIENT DBMS
APPLICATION

Network Connection

Server Machine

SERVER DBMS
APPLICATION
DATABASE SYSTEM
DBMS Three level Architecture
This architecture has three levels
1. External level
2. Conceptual level
3. Internal level
External level:
It is also called view level because several users can view their
desired data from this level which is internally fetched
from database with the help of conceptual and internal
level mapping.
External level is the top level of three level architecture. At
this level user doesn’t need to know about database schema
details such as data structure, table definition etc.
Conceptual level:
It is also called logical level. The whole design of the
database such as relationship among data, schema of
data are described in this level. Database constraints
and security are also implemented in this level. This
level is maintained by Database administrator (DBA).
Internal level:
This level is also known as physical level. This level
describes how data is actually stored in the storage
devices. This level is also responsible for allocating
space for the data.
External Level
User 1 User 2 User 3 User n

View 1 View 2 View 3 View n

Conceptual level

Internal level

Database
Schema in DBMS
DBMS Schema: Design of a database is called the
schema. Schema is of three types:
1. Physical Schema
2. Logical Schema
3. View Schema
Physical Schema:
The design of database at physical level is called physical
schema, how the data is stored in blocks of storage is
described at this level.
Logical Schema:
Design of database at logical level is called logical
schema, programmers and database administrators
work at this level. At this level, how data records are
stored in data structures is described.
View Schema:
Design of database at view level is called view schema.
This generally describes end user interaction with
database system.
DBMS Schema Example
In the following diagram, we have a schema that shows the
relationship between three tables: Course, student and
section. The diagram only shows the design of the
database, it doesn’t show the data present in those tables.
Schema is only the design/ structural view of database.

Course Student
Course_id Student_id
Course_name Student_name
Department Course_id

Section
Student_id
Section_id
Course_id
DBMS Instance:
The data stored in database at a particular moment of
time is called instance of database. For example, we
have a single table student in the database, today the
table has 100 records, so the instance of database has
100 records. If tomorrow we add 200 more records in
the database then the instance of database tomorrow
will have 300 records.
Data Abstraction in DBMS:
Database systems are made of complex data structures.
To ease the user interaction with data base, the
developers hide irrelevant details from users. This
process of hiding irrelevant details from user is called
data abstraction.
DBMS Languages
 DBMS Languages are used to read, update and store
data in a database. There are several such languages
that can be used for this purpose; one of them is
SQL(structured query language). Commands of this
language are categorized under following heading:
 DDL – Data Definition Language
 DML – Data Manipulation Language
 DCL – Data Control Language
 TCL – Transaction Control Language
Types of DBMS Language

Data Transaction
Data Definition Data Control
Manipulation control
Language Language
Language Language

Create Select Revoke Rollback


Drop Insert Grant Commit
Truncate Delete
Rename Update
DBMS Language Hierarchy
DDL – Data Definition Language
 It is used for creating tables, schema, indexes, constraints
etc. Given below are the operations that we perform on a
database using DDL commands:
 To Create database instance – CREATE
 To Alter(change) the structure of database- ALTER
 To drop(delete) database instances – DROP
 To delete a table in a database – TRUNCATE
 To rename database instances – RENAME
 To drop(delete) objects from database such as tables –
DROP
 To Comment - COMMENT
DML – Data Manipulation
Language
 DML is used to access and manipulate data in a
database.
 Following are the operations on database using DML
commands
 To read records from tables – SELECT
 To insert records into tables – INSERT
 Update the data in tables – UPDATE
 Delete all records from tables - DELETE
DCL – Data Control Language:
DCL Commands are used to grant and revoke access on a
database
 To grant(give/provide) access to user – GRANT
 To revoke(take back) access from user - REVOKE
TCL – Transaction Control Language:
The changes made in a database are performed or
rollback using TCL commands
 To persist the changes made by using other commands
in a database – COMMIT
 To roll – back the changes made to the database -
ROLLBACK

You might also like