Module-1 - DBMS Final
Module-1 - DBMS Final
daba)
Having undensiood Jhe Concept o6 database (collecion of velahed
and ushy do We need database (fer esfcienty Solviy a problem
Nlow We,
oiu shedy what is DBMS.
B Data
Data
M Daa
(usen Daba
4sey Comnnicate to S Daba
bBMS interfac. for
efhient and faster
Diff Progpam
Cocle to in sert Daabase
way os Guil th Aling his dalet, update
Crd quoy dateubane
Tequivemont
infovmahon
prvides Qn
intonface to þei7otm vasous operchbny
liKe daabase Creahon, Serinr data updakns, doleiny data,
L poonden rolechon nd Secuihy to Jhe databane
DeMS’sohuane /managemont of daabase
Allows usen the follootng tas Ks.
(a)
CDaa. definahon : Used for cieahon , modiffcaion cand
that doGnes dhe
definihon -hat 7anizohen t
Temova o
Ihe daa
(o) Dala up daion.. Used for insenhon modifaakon ond cdeleion
aChual dala database
Tehievent data fom cdakaban
Daa retieval: used for
L All MOdean bBMS hke SQL, MYSQL ^eve , lBs DB2 yacle and
micYosot aC Ces based On ROMS
Based on, selahonal data model DBMS for veahonal(table)
L Al opeyahono liKe in Sert dolota "ane þergomed on
tables
Data is Depre Sented in tesm ok tuply CoLos) n RDBMS
Due. o a Collechon of oYganized Ser oG tables, dae
Can be accened eanily in RDBMS
4
Records
Emp_i E Name Post Salay
tuples Rahul Cleik D0,000
E2
Rows
or Kapil Managen 80, o00
E3 Mukesh clenk 20, o00
E4
Manoj leon Lo, od0
E5
Radha 80, o00
E6
Shweta Manajea
Clik 20, o00
|File syslem
f-J
disk
file sysla
Hand dis
fle Syston but we ane wsiny D8MS
not emoved
We hawe
Jhe sota. moree etiieny.
to manaye
et take an eyample ! oc Shdont data in nvasiy
tneis O6 dBMS
what e dhe domeiG of Ale syslem
shucluved data pyecdetined ’ easy data
acle
File sysem daa ype is
( stuched data. ’
DBMS
Matl ilems arayemont
Road ije nalage Acodeni,
cifferent sechon ( Acco DD- MM- YYYY
Diff pepk Date’
kollow dif. (onak MMa DD -YYYY
may utich Con MM- yy- DD
ile bamed sysonm
inconsisleney qlso YY- DD- My
(ead to clala
have stuolned data
DBMS we
but in
Data models in DBMS help to understand the design at the conceptual, physical, and logical levels as it provides a clear
picture of the data making it easier for developers to create a physical database.
Data models are used to describe how the data is stored, accessed, and updated in a DBMS. A set of symbols and text
is used to represent them so that all the members of an organization can understand how the data is organized. It
provides a set of conceptual tools that are vastly used to represent the description of data.
The hierarchical data model is one of the oldest data models, developed in the 1950s by IBM. In this data model, the
data is organized in a hierarchical tree-like structure. This data model can be easily visualized because each record in
DBMS has one parent and many children (possibly 0) as shown in the image given below.
A network model is nothing but a generalization of the hierarchical data model as this data model allows many to many
relationships therefore in this model a record can also have more than one parent.
The network model in DBMS can be represented as a graph and hence it replaces the hierarchical tree with a graph in
which object types are the nodes and relationships are the edges.
(c) Entity-Relationship Model (ER Model)
An Entity-Relationship model is a high-level data model that describes the structure of the database in a pictorial form
which is known as ER-diagram. In simple words, an ER diagram is used to represent logical structure of the database
easily.
ER model develops a conceptual view of the data hence it can be used as a blueprint to implement the database in the
future.
Developers can easily understand the system just by looking at ER diagram. Let's first have a look at the components
of an ER diagram.
Entity - Anything that has an independent existence about which we collect the data. To learn more about Entity in
DBMS click here.
They are represented as rectangles in the ER diagram. For example - Car, house, employee.
Entity Set - A set of the same type of entities is known as an entity set. For example - Set of students studying in a
college.
Attributes - Properties that define entities are called attributes. They are represented by an ellipse shape.
Relationships - A relationship in DBMS is used to describe the association between entities. They are represented as
diamond or rhombus shapes in the ER diagram.
In the above-represented ER diagram, we have two entities that are Employee and Company, and the relationship
among them. Also, in the above-represented ER diagram, we can see that both the employee and company have some
attributes and the relationship is of "works in" type, which means the employee works in a company.
(d) Relational Model
This is the most widely accepted data model. In this model, the database is represented as a collection of relations in
the form of rows and columns of a two-dimensional table. Each row is known as a tuple (a tuple contains all the data
for an individual record) while each column represents an attribute. For example -
The above table shows a relation "STUDENT" with attributes such as Stu. Id, Name, and Branch which consists of 4
records or tuples.
As suggested by its name, the object-oriented data model is a combination of object-oriented programming and
relational data model. In this data model, the data and their relationship are represented in a single structure which
is known as an object.
Since data is stored as objects we can easily store audio, video, images, etc in the database which was very difficult
and inconvenient to do in the relational model. As shown in the image below two objects are connected with each
other through links.
In the above image, we have two objects that are Employee and Department in which all the data is contained in a
single unit (object). They are linked with each other as they share a common attribute i.e. department_id
(f) Object Relational Data Model
Again as suggested by its name, the object-relational data model is an integration of the object-oriented model and
the relational model. Since it inherits properties from both of the models it supports objects, classes, etc like object-
oriented models, and tabular structures like the relational model.
Schona.
o6 Coect
aSeloct Comnicar
olaa
aCCos fer
tool
hendy Dhis
intenaci'
on pla
the
oncoos
opt clone d'Yectly
Con DBs
need
we for pialtesm
example
DBMS
wjh be ony
A (maion) infoahon
to uned
DBMS clisecty lnguoye
Usen Cen Fr ’
tontmanagement.
.claba,
impor Jawa
languaye
cny
(in
Conci
the on auchiechye&
de.
of Databne qpplicai Aexpcundimacine
client
any for
Data to oiee cloest
ibel,
94
local JDBeCinrochi
Arehieie it
Cihical available.
he91e for
DBMS/ a9chitechuve
Arei
techm o Seswer ne.
dalab
Java
is Av
ajsechve e dovelomeat Senu
en(client- ODBC1
trekilec done. se i
DBMS dotcba
og ctiyecHy for Ofhce
Ms
eq. Lwe
Can
use
ce fAient Jhe
3Tie Oot Hen Any
changes Suilabla dclaloou onlyWe
veVS far open
to
a DBMS|tie1
- her darabana aychitecwe
Syslemcho ^ecuvely. ie Dalabone
aachilecve
2Ties
ano inmducicn le store NO-
wed applicahong
todays AP's
for 2
3
ODBC
File
dalabse Same
-’ San and
quicuy Types
aMchilechYe
(a)
1-
tie
Lec-I -a
lec
Ly
Lot
w A
(0) 2)
Seswes
Serven
Sowe
aComecie cient Cnd
Cient
SeweN
oih
Senven Clieat
utich
rovlhen
cemuicat
cala
cat teracli
Comeni
esryishon Deskto
papplicaiony atni
|Applitaion in 1Appl
SeveN
S
DBM Dalaba Use
USe loyen end
no
hen web
clive
cty
aicaon ent
cli
lape
Can
h
side.
ey
ampleg
’ 3-
Tien
Arclilecue aken for
on
Applic
clien
Conlai
Seyen used
chent
L
L
L
enG colvefi.
velayonl
in
dalclane Canephod
Schene, stchne
clala
Ohone
uhia
Sysle
m dechni
dala ancd
name
of orgomized objec inced
held
o
vepvenonlei oG
pant to schema typically
Cyel
Snvolved.
dalabou
Schem
Schema
be Compan
teguivemo
projeck
ARCHITECTU
RE Schome dotonengm
Conshci
tubte Synax
luds
inc
logicad co
not
Cogical
databan ure Cne
Less
clean,
cbstact
aban
pic houwbu'snen
ruler
inkpiy
dal Ihey
DBMS physicad big wwually
iniil JheySueh
SchemaConcepul Cisntin
offers
phys'cal:
MonuE-9 y
Ls Conaphal Cogicad
Concept
(a)
Lec-3
Lec-4’ Lec-2 Lec
Schemna ’
for
Extenal
schema
aMchiechures D3MS
hhat is
ConcoptDBMS File
Quwshion
Aie Sys
Stou
chye ok lem
table
Slore Schema Vs
ue 20 Houo CEPTUAL
CoN
PHYsICAL tencQ Ex DBMS
soye SCHEMA
ScHEMA cro
table
Jhen Jha dhe
iim-acjn.
Anit Schema Lec-y
d wtich Jhyee
data data
above
(ouel
Cin yn
clale
(Etupkat,
çomaion) ER schona
o Ralaliaad Extesna
Can
in Schemos
Amozon, stuce anchece.
tables, whc cismbuta
Conwoli3el
con ke be. .
Pad
is s
tove CPhysiSntesnal
cleau)ue) togicadCaue
schema
Jhen Jhe Qm
ele:) in level)
yied
struchye to
Usig
Y)
6
to
lo
isinkomain
Lha acce
Cant
inteact
skoved ciff. uew
dat
isfer is lno)
do Afendonce (
indepencone
data
and
Usen ca
fenont Wedile.Schema
diyecHy vieos.
mls poic,
(ees
Ahoyh Cevel pasuoord Use
ale
for c
he
Mol
peon
on
sn
manu
physicoll, per exten
vole
Don 2e ot
Jhe w
data View
ord View
(for it
fomm uthee om: manls Shudet
foViecs yne
(heu to
or dau ys login
fepyesent
icd
(acug
Saefor cifforuntTfaculg login sJhat
is
the
Use)
utich mana. Unedin
pafe
knoe schoma kils Role
Selec
avels 9n stoved
is Shou.
toHo0 A shown is
evel
Jhvec Sloved, F8 shudent
coñ GnmaiL
f.
Unive1sil new
Jis
But
made wtonee
Extenal vieuhuder
S we
See
USen
is Take
when
we
No
#Why e
2 solaianhip
a /shems call, lo (reymen.
mauy
telaionlp. tieh Cie)
schema
Extenal
physi
fiw
Concenheel
viesschoma mods
fere to schoma
Physicod
alh
enhien
bu be Rolaicnal is data,dise,chjie le
DBMS)
(Cayen
bluepink daba eh cMow schema
Concephol
in
Tables istorad
ele
). INRo
Jhe decid,
Dnd
ondl
Schoma
ER
,Age. dale
stoyod
isdata male
atmin
Dabon
lelahonal
Moclel dala ia
DB’
Achl
Concopheal
schorna Roll
no)
Moclol o6 schoma inten
(au Admin
palabo
doisner
Bavah
an
deignen
Usen
See
exampe
dabab
an
HowSudont
Wehue
to ER cal bu
physi
she
So :NOTE
e. *
3
DBMS Architecture
• The DBMS design depends upon its architecture. So, DBMS architecture depends upon how users can connect
to the database to meet their requirements.
• The architecture of a database management system plays an important role in determining the actual design and
layout of the database
• To understand the DBMS architecture, you must have a clear idea about the client and server. The client is the
user requesting service, in this case, access to the data stored in the database. The server side is the side that
answers the request of the client.
•The user directly interacts with the database itself, which means that it is accessible to the user to create, alter or
delete the data
•In simple words, in 1-tier architecture, the user can directly sit on the DBMS and uses it.
•1-tier architecture is rarely used in production. It is used where the quick response is required. For example,
development of the local application
• The user directly sits on the database, and there is no layer between
the user and the database. Therefore, there is no data abstraction; the
whole data is available. There is no interactive user interface.
ODBC:
JDBC:
•But problem with this architecture is scalability. Scalability means when the number of users increased then two-
tier architecture does not work properly.
•Security is other main problem because It does not allow the role base access. It means author can work as
administrator because every client has direct and similar access to database.
•Traffic load on database server is high because it first processes the query and then provides the required data
as well.
Example of 2-TIER AND 3 TIER ARCHITECTURE: Ticket counter and IRCTC , Bank counter and online banking
3-Tier Architecture
•In 3-tier architecture, client cannot directly communicate with the database server. It contains another layer
(application layer) between the client and server.
•The user on the client-end interacts with an application server (also called business layer) which further
communicates with the database system.
•End user has no idea about database and database also has no idea about any end user. The 3-Tier architecture
mostly use in web application.
• Any modification in the data done by the user does not directly affect the database itself. The changes are first
performed on the application layer. There is no real connection between the database and the user.
• The query processing and other functionalities of the database management system are performed at the server-
side application.
• It allows the DBA to manage the access of the various users. It also enables concurrent transactions on the
database.
3-Schema Architecture
The three schema architecture divides the database into three-level to create a separation between the physical
database and the user application. In simple words, this architecture hides the details of physical storage from the
user. The database administrator (DBA) should be able to change the structure of database storage without affecting
the user’s view.
This architecture contains three layers or levels of the database management system:
• External level
• Conceptual level
• Internal level
Three schema architecture hides the details of DB from the user. It’s other name is three Level of Abstraction.
The database administrator should be able to change the structure of database as according to need, without
affecting the user’s view. This effective three schema architecture holds 3-layers as below
•External or view level tells the actual view of data that is relevant to the particular user.
•View/External level provides different views of the same DB for a specific user or a group of users. For example
view for faculty student is different than faculty admin.
•External level develops with the help of front end programming (Javascript, HTML etc)
•An external view provides a powerful and flexible security by hiding some information of the database from a
particular user.
3-Tier Architecture
2. Conceptual or Logical level
•The logical/conceptual level tells the structure of the entire database.
•Conceptual level acts as a intermediate layer between the physical storage(DB) and external level.
•Database designer works on this layer which provides the structure of database.
•Database any model (i.e. Relational or ER Model) can use at this level which provides the structure of database.
i.e Gmail makes changes in conceptual and physical schema at regular basis without changing the user view.
Schema and Instance
•The collection of information stored in the database at a particular moment of time is called database
instance.
•The overall design or structure of the database is called database Schema
Types of Schema
The different types of schemas are as follows −
•Physical schema − It is a database design at the physical level.It is hidden below the logical schema and can be
changed easily without affecting the application programs.
•Logical schema − It is a database design at the logical level. Programmers construct applications using logical
schema.
•External − It is schema at view level. It is the highest level of a schema which defines the views for end users.
Schema and Instance
Database Languages
Database Languages
Database Languages
Database Key Features
Database Key Features