Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
0% found this document useful (0 votes)
2 views

CH 1 Database Session-1

Uploaded by

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

CH 1 Database Session-1

Uploaded by

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

CH-

1 DATABAS
ECONCEPTS

Dat
a

Datai
sacol
le
cti
onoff
actsinar
awo
runo
rgani
zedf
orms
uchasnumbe
rso
rchar
act
ers
.
Exampl
e:Ankit
,De
lhi
,12,8
0.

Inf
ormatio
n
Inf
ormati
onisdat
athathasbe
enconver
tedi
ntoamoreuse
ful
,me
ani
ngf
ulf
orm.
Example
:Name–Ankit,Ci
ty–Del
hi,Cl
ass–1
2,Marks–80
.

Dat
abas
e

Therelate
dinfor
mat i
onwhe npl
ace
dinanorg
anizedfo
rmmakesadat
abase.
Wecano
rgani
ze
rel
atedinfor
mationintheformoff
il
eso
rfo
lders(
Fil
ebase
dsys
tem)
orinfo
rmo f
tabl
es(
Relati
onaldat
abase)

Dat
abas
eManag
eme
ntS
yst
em(
DBMS
)

Adatabasemanageme ntsys
temorDBMSi sas o
ftwareusedf o
rcreat
ingandmanag ingthe
datai
nthedatabaseeasi
lyandeff
ect
ivel
y.Itisbasi
call
yas etofprog
ramst hatal
lowusersto
sto
re,
modify/
update,andret
rie
veinfo
rmationfromt hedatabaseaspertherequi
rements.
DBMSalsopro
videssecuri
tyandprote
cti
ont othedatabase
.DBMSac tsasami ddl
elayer
betwe
enthedatabaseandtheuser
.

Example:MyS
QL,MSSQLSer
ver
,Or
acl
e,S
QL,
DB2,
Mic
ros
oftAc
ces
s,e
tc.
aredi
ffe
rentt
ype
sof
databas
emanage
mentsys
tem.
Ne
edf
orDat
abas
e

SizeofData:Thesmal lamountofdatasto
ringi
ntospre
adshe e
tisfine,ho
we veri
tmi g
htturns
intoalarg
eamo untofdatathenSpreads
heetso
luti
onwi l
lnotwo rk.Evenifthesi
z eofdata
recor
dsgoesi
nt omi l
li
onsthensto
ringdatainmulti
plespreadshe
etwhi chwi l
lcr
eat ea
problemofspeed.Itwil
l t
akeyoulongtimetofi
ndar ec
ordf ro
mt hemul ti
plespreadsheet
fil
es.

Eas
eofUpdat
ingData:
Mul t
iplepeo
ple
scannote
ditt
hesamefil
eonsameti
me.
Othe
rpe
opl
es
mustwai
tuntil
fil
esareavai
lablet
oupdatewhic
hresul
tsi
ntowast
ageoft
ime
.

Accurac
y:Whenuserdoi
ngdat
ae ntr
yinfi
lesthenitmightbepossi
bletoi
nco
rrectdat
adue
tonovali
dati
onpre
sentli
keyoucanent
erwr ongspel
li
ng,wrongdates
,andwrongamount.
So
theDataacc
urac
yishardtomaintai
nandaccuracyisinques
t i
on.

Se
c uri
ty:
Yo ucannotse
c urethedatai
nthetextfi
lesandspreadsheet
.Anyonecanac
ces
sthe
fi
leandreadanydat apr e
sentinthef
ile
.Sos
tori
ngdat awil
lno tworkwithbanking
,
healt
hcar
eappl i
cat
ion,payr o
llde
partmentwhereprivacyi
sdi ff
icul
ttomaintai
n.

Redundancy:Thedupli
cati
ono
fdatacanbepossi
bleusingtextfi
leso
rs pr
eads
hee
t.Chanc
eso
f
addi
ngmul ti
pleco
pieso
fdatac
annotbeli
mi t
edhere.Thiswilll
eadstoacc
urac
yiss
ue s
.
Maintai
ningandupdatingmul
tipl
ecopi
esisnotaneasyt as
k.

I
nco
mpl e
teData:So
meo ft
hedatai
snotcons
ider
ednoti
mportant
,sos
uchdatano
tent
ere
din
t
hefi
leasnovali
datio
ninplac
ewhichle
adsthedat
ainte
gri
tyisi
nque s
tio
n.

Topre
ventabovepro
ble
mas
soc
iat
edwi
ths
tor
ingdat
aint
het
extf
il
eors
pre
ads
hee
tthe
dat
abasei
srequir
ed.

Char
act
eri
sti
cso
fDBMS

Ther
earevariusc
o haracte
ris
tic
sofadat
abas
emanag
eme
nts
yst
em,
butf
oll
owi
ngar
eso
me
impor
tantcharac
ter
isti
cs:
1.Se
lf-Desc
ribi
ngNat ur e
BeforeDBMS ,t
radi tionalfi
lemanag e
me ntsystem wasusedforst
oringinfor
mat i
onanddat a.
Therewasnoc onc epto fdef
initi
oni nt radi
t i
onalfi
lemanag ementsysteml i
kewehavei n
DBMS .ADBMSs ho uldbeo fSelf
-De sc
ribingnatureasitnotonlycontainsthedatabas
eitsel
f
butalsotheme tadat a.Ame tadata(dataaboutdata)def
inesanddescri
besnotonlytheextent,
type,structur
eandf ormato fal ldatabutal s
or e
lat
ionshi
pbe tweent hedata.Thisdata
representi
tsel
ft hatwhatac ti
onsshouldbet akenonit.

2.S
upportACIDPr o
pe rti
es
Any DBMSi sabl
et osupportAC ID(Acc
urac
y,Complet
eness,Is
olatio
n,andDur abil
ity)
pro
perti
es.
I tismades ureineveryDBMSt hatthere
alpurposeofdat ashouldnotbelost
whil
eperformingtransacti
onsli
ked e
let
e,i
nser
tandupdate.Letust akeane xample
;ifan
emplo
yeenamei supdat edthenitshoul
dmakes ur
ethatthe
r eisnodupl i
catedat
aandno
mismatc
ho femplo
ye einfo
rmation.

3.Concurre
ntUs eofDatabas e
Therearemanyc hancest hatmanyus er
swi l
lbeac c
e s
singt hedat aatthesametime.They
mayr equireal
teri
ngt hedat abas
es yst
emc oncurrently.Atthatt ime ,
DBMSs uppo
rtsthemto
concurre
ntlyusethedat abas ewithoutanypr o
blem. Witht hehe lpofco
ncurrenc
y,ec
o no
my
ofthesystemcanbei ncreased.Fo
rExampl e,theempl oyeesofr ail
wayr es
ervati
onsyst
e mcan
bookandac c
essticketsfo rpassenger
sc o
nc urrentl
y.Eve rye mpl o
yeecans eeonhiso wn
interf
acethathowmanys eatsareavail
ableorbog i
eisfullybo oked.

4.Ins
ulationBetweenDataandPr ogram
Progr
am dat ai ndepe
ndenceprovi
d e
sabi gr e
lie
ft odatabaseus e
r s
.Intradit
ionalfil
e
manag ementsystem,st
ruct
ureofd ataf i
leswasde fi
nedintheapplicati
onprog
ramss ouse
r
hadtochangealltheprog
ramsthatar eusingthatpartic
ulardatafil
e.
ButinDBMS ,st
r uc
tureofdatafil
esi snots t
oredinthepr o
gram butitisst
oredinsystem
catal
ogue.
Wi t
ht hehelpofthis
,internalimpr ovementofdatae f
fic
iencyoranychang e
sin
thedatadonothaveanye ff
ectontheappl icati
onsoft
war e
.

5.
Tr ans ac
t i
o ns
Trans acti
onsar ebuncho fac ti
onsthatar edo
net obr i
ngt hedatabasefromo nec o
ns is
tent
st
atet one wc ons i
ste
nts tate.Tradit
ionalfil
e-
baseds ystem didno thavet hisfe ature
.
Trans acti
oni salwaysat omi cthatme ansitcanne verbef urtherdivided.Itcano nlybe
co
mpl et
eo rinc o
mpl ete
.
Fore xampl e, Ape rs
onwant stocredi
tmo neyfrom hisac c
ountt oanotherperson’
sac co
unt.
Thent r
ans actionwi l
lbecompl eteifhes e
ndsthemo neyando t
he rguyr e
ceivesthemo ney.
Anyt hingo thert hanthisc
anl eadtoani nco
nsi
ste
nttr ansacti
on.

6.
DataPe rs
ist
ence
Per
sis
tencemeansifthedataisnotremovedexpli
cit
lythenallt
hedat
awillbemaintai
nedin
DBMS.Ifanysystemfail
ur ehappensthe
nl i
fespanofdatast
oredi
ntheDBMSwi l
lbedeci
ded
bytheusersdire
ctl
yo rindire
ctl
y.Anydat astore
dint heDBMScanneve
rbel o
st.I
fsyst
em
f
ail
urehappensi
nbetweenanyt
rans
act
iont
heni
twi
llber
oll
edbac
korf
ull
yco
mpl
ete
d,but
t
hedatawill
neverbeatr
isk.

7.Backupandrecover
y
Therearemanyc hancesoff
ail
ureofwholedatabase
.Att
hattimenoonewil
lbeabl
etoget
thedatabas
ebackandf o
rsurecompanywi llbeinabiglo
ss.
Theonlysol
uti
onistotake
backupofdatabaseandwhe ne
veritisnee
ded,itcanbes
tor
edback.
Adatabasemusthave
thisc
haract
eri
stictoe
nablemoree
ffec
tive
ness
.

8.Datainteg
rity
Thisisoneofthemo s
timportantcharac
teris
tic
sofdat
abasemanage
me ntsys
tem.Inte
grity
ensuresthequali
tyandre
liabil
ityofdatabases
yste
m.Itprot
ect
stheunauthor
ize
dac c
essof
databaseandmake si
tmores ec
ure.I
tbringsonl
ythecons
iste
nceandaccur
atedataintothe
database.

9.Multipl
eViews
Userscanhavemul t
ipleviewsofdatabasedependingontheirdepar
tme ntandint
e rest
.DBMS
supportmultiplevi
ewso fdatabas
et otheuse r
s.Forexample,auserofteac
hingde part
me nt
willhavediff
erentvie
wandus erofhosteldepartmentwillhavediff
erent.
Thisf
e aturehelp
userstohavesomewhatsecuri
t ybec
auseus er
so fot
herdepartmentcannotacce
ssthe i
rfil
es.

10.
Stor
e sAnykindofdata
Adatabasemanageme nts
yste
ms houl
dbeabl
etostor
eanykindofdat
a.Itshoul
dnotbe
re
stri
ctedtoemployeename,s
alaryandaddres
s.Anykindo
fdatathatexi
stsinthereal
worl
dc anbesto
redinDBMSbe causewenee
dtowo r
kwi t
hal
lkindso
fdatathatispr
ese
nt
aro
undus .

11.
Securit
y
DBMSpr ovide
ssec
uri
tytothedatas
toredi
nitbe c
auseal
lusershavediff
ere
ntrig
htstoacc
ess
thedatabase.
Someoftheusercanacc
essthewho l
edatabas
ewhi leotherc
anaccessasmall
partofdatabase.
Forexample,aco
mput e
rne tworklec
turercano nlyacc
essfi
lesthatare
rel
atedtocomputers
ubjec
tsbutHODofthedepartmentcanacces
sfile
sofal
lsubj
ectthatare
rel
atedtothei
rdepar
tment.

12.Repre
sent
scomplexre
lat
ionshipbetweendata
Datastor
edinadatabas
eisco
nne ct
edwi t
he ac
ho t
herandarelati
ons
hipismadei
nbet
ween
data.DBMSs ho
uldbeabletor epres
entt hecomple
xr e
lat
ionshi
pbe t
we e
ndatatomake
eff
ici
entandaccur
ateus
eofdata.

Advant
ageo
fDBMS

1
.Impr
ove
ddat
ashar
ing
:
 TheDBMShe
lpsc
reat
eane
nvi
ronme
nti
nwhi
che
ndus
ershavebe
tte
rac
ces
stomo
re
andbett
er-manage
ddata.
 Suchacc
essmakesitpo
ssi
blef
ore
ndus
erst
ore
spo
ndqui
ckl
ytoc
hang
esi
nthe
ir
envir
onme nt
.

2.
Impr
ove
ddat
ase
cur
ity:

 Themo
reus
ersac
ces
sthedat
a,t
heg
reat
ert
her
iskso
fdat
ase
cur
ity
bre
aches
.Cor
porationsinves
tcons
ide
rableamountso
fti
me,e
ffo
rt,andmone
yt o
ens
urethatcorporatedataareus
edproperl
y.
 ADBMSp r
ovidesaframe workfo
rbett
erenfor
cemento
fdat
aprivacyands
ecuri
ty
pol
ic
ies
.

3.
Bet
terdat
aint
egr
ati
on:

 Wi
derac
ces
stowe
ll
-manag
eddat
apr
omo
tesani
nte
grat
edvi
ewo
ftheo
rgani
zat
ion’
s
o
per
ati
onsandac
lear
ervi
ewo
fthebi
gpi
ctur
e.
 I
tbe
come
smuc
heas
iert
ose
eho
wac
tio
nsi
nones
egme
nto
fthec
ompanyaf
fec
tot
her
s
egme
nts
.

4.
Mini
miz
eddat
ainc
ons
ist
enc
y:

 Dat
ainc
ons
ist
enc
yexi
stswhe
ndi
ffe
rentve
rsi
onso
fthes
amedat
aappe
ari
n
dif
ferentplac es.
 Forexampl e,datainc o
ns ist
encyexist
swhe nacompany’ssal
esdepartmentstor
esa
sal
esrepr es
ent ati
ve ’
snameas“ Bi
llBrown”andthecompany’sperso
nneldepartment
sto
resthats amepe r s
on’snameas“ WilliamG.Bro
wn,”orwhent hecompany’sreg
ional
sal
esofficeshowst hepric eofaproductas$45.
95anditsnati
onalsale
soffi
ceshowsthe
samepr oduct’spriceas$43. 95
.
 Thepr obabili
tyo fdatai nconsi
ste
ncyi sgre
atl
yreducedinaproperl
ydesigned
database.

5
.Impr
ove
ddat
aac
ces
s:

 TheDBMSmakesi
tposs
iblet
oproducequi
ckanswe
rst
oadhocquer
ies
.
 Fro
madatabas
epers
pecti
ve,aquer
yi sas
pec
ifi
cre
ques
tis
suedtot
heDBMSf
ordat
a
manipulation—fo
rexample,t
or e
ado rupdatethedata.S
implyput,aquer
yisa
ques
tion,andanadho cque
ryisas pur-o
f-t
he-mome ntques
tio
n.
 TheDBMSs e
ndsbackananswe r(
call
e dt
heque ryresul
tset
)totheappl
ic
atio
n.
 Forexampl e
,enduse
rs

6.
Impr
ove
dde
cis
ionmaki
ng:

 Be
tte
r-manag
eddat
aandi
mpr
ove
ddat
aac
ces
smakei
tpo
ssi
blet
oge
ner
atebe
tte
r-
qualit
yinf o
rmation,onwhi chbe tt
erdecis
ionsarebased.
 Thequalityoftheinformat io
ng enerate
dde pendsonthequalityoftheunderlying
data.
 Dataqualityisacompr ehensiveappr o
achtopr omoti
ngt heacc
uracy,vali
dit
y, and
timeli
nessofthedata.Whi l
etheDBMSdo esnotguaranteedataquality,
itprovidesa
framewor ktofac
ilit
atedat aqualityiniti
atives.
 Incre
asedend-use
rpr oductivi
t y
 Theavailabil
ityofdata,combi nedwiththet ool
sthattransfo
rmdat aintousable
infor
mat io
n,empo wersendus erstomakequi ck,inf
orme ddec
isi
onsthatcanmaket he
diff
erencebetweensuccessandf ail
ureintheg l
obaleco
no my.

Di
sadvant
ageo
fDBMS

1
.Inc
reas
edc
ost
s:

 Dat
abas
esys
temsr
equi
res
ophi
sti
cat
edhar
dwar
eands
oft
war
eandhi
ghl
yski
ll
ed
pe
rso
nne
l.
 Thec
osto
fmai
ntai
ningt
hehar
dwar
e,s
oft
war
e,andpe
rso
nne
lre
qui
redt
oope
rat
eand
manag
eadat
abasesys
temcanbesubs
tanti
al.
Training,
li
cens
ing,
andreg
ulat
ion
c
ompli
anc
eco
stsareof
teno
verl
ookedwhendatabasesys
temsareimpl
emente
d.

2.
Manag
eme
ntc
ompl
exi
ty:

 Dat
abas
esys
temsi
nte
rfac
ewi
thmanydi
ffe
rentt
echno
log
iesandhaveas
igni
fic
ant
i
mpacto nacompany’
sr e
source
sandc ul
ture.
 Thec
hang e
sintro
ducedbytheadoptionofadatabasesys
temmus tbepro
per
ly
managedtoensur
ethattheyhelpadvancethecompany’sobj
ect
ives.
Give
nthefac
t
t
hatdatabasesys
temsholdcruci
alcompanydat athatareac
ces
sedfrommulti
ple
s
ource
s,sec
urit
yissue
smus tbeasse
ssedcons
tantly.

3.
Mai
ntai
ningc
urr
enc
y:

 Tomaxi
miz
ethee
ffi
cie
ncyo
fthedat
abas
esys
tem,
youmus
tke
epyo
urs
yst
em
current.
 Therefor
e,youmus tperfo
rmf requentupdatesandappl
ythelates
tpatc
hesand
sec
urityme asur e
stoallcomponents.
 Becausedatabaset e
chnolog
yadvanc esrapi
dly,per
sonne
ltr
ainingcos
tst
endtobe
sig
nific
ant.Ve ndordependenc
e.
 Giventhehe avyi nvest
me ntintechnol
ogyandpe r
sonne
ltr
aining,
compani
esmightbe
rel
uctanttoc hangedatabasevendors.
4.
Fre
que
ntupg
rade
/re
plac
eme
ntc
ycl
es:

 DBMSve
ndo
rsf
reque
ntl
yupg
radet
hei
rpr
oduc
tsbyaddi
ngne
wfunc
tio
nal
ity.
Suc
h
newfeature
soft
e ncomebund l
edinnewupg r
adever
sio
nso ft
hesoft
war e
.
 So
meo fthes
eversio
nsrequirehar
dwar eupgr
ades
.Notonl
ydot heupgr
adesthemse
lve
s
co
stmo ney,
butitalsoc
ost
smo neytotrai
ndatabas
eusersandadminist
rato
r st
o
prope
rlyuseandmanag ethenewf e
atures
.

Co
mpone
ntsofDBMS
1.Sof
tware
2.Har
dwar
e
3.Pr
oce
dur
es
4.Dat
a
5
.Us
ers

S
oft
ware
 Themainco
mpo nentofaDat
abasemanageme
ntsys
temist
hesof
tware.
Iti
sthes
eto
f
prog
ramswhichisuse
dtomanagethedat
abas
eandtoc
ontr
olt
heover
all
co
mputeri
zeddatabas
e.
 TheDBMSs
oft
war
epr
ovi
desane
asy-
to-
usei
nte
rfac
etos
tor
e,r
etr
ieve
,andupdat
e
dat
aint
hedat
abas
e.
 Thi
sso
ftwar
eco
mpo
nenti
scapabl
eofunde
rst
andi
ngt
heDat
abas
eAc
ces
sLang
uag
e
andc
onve
rtsi
tint
oac
tual
dat
abas
eco
mmandst
oexe
cut
eorr
unt
hemo
nthedat
abas
e.

Har
dware
 Thi
sco
mpo
nento
fDBMSc
ons
ist
sofas
eto
fphys
ical
ele
ctr
oni
cde
vic
ess
uchas
c
omput
ers,
I/Oc
hannel
s,s
tor
agede
vic
es,
etct
hatc
reat
eani
nte
rfac
ebe
twe
en
c
omput
ersandtheus
ers
.
 Thi
sDBMSc
ompo
nenti
sus
edf
orke
epi
ngands
tor
ingt
hedat
aint
hedat
abas
e.
Pr
oce
dures
 P roc
eduresref
ertoge
neral
rul
esandins
truc
tio
nst
hathe
lpt
ode
sig
nthedat
abas
eand
touseadatabasemanag
ementsys
tem.
 Procedur esar eus edt ose t
upandi ns tallanewdat abas emanag e mentsyste
m(DBMS )
,
tolog
inandl o g
outo fDBMSs oft
war e ,tomanag eDBMSo rapplicatio
npr ogr
ams,totake
backupo ft hedat abas e,andt ochang et hestruc t
ureo fthedatabas e,e
tc.
Data
 I ti
st hemo s timpo rt
antc ompo nento fthedat abasemanag eme ntsystem.
 T hemai nt as ko fDBMSi st oprocessthedat a.He re,databasesar ede
f i
ned,c
onst
ructed,
andthe ndat aiss tor
e d,r e
tr i
eved,andupdat edt oandf r o
mt hedat abases
.
 T hedat abas econt ainsbo t
ht heme t adat a(
descr i
ptionabo utdat aordataaboutdata)
andtheac t
ual (
oro per ational)data.
Use
rs
 T heus ersar ethepe oplewhoc ontrol andmanag ethedat abasesandpe rfo
rmdiffer
e nt
typesofo per ati
o nsont hedat abasesi nt hedat abasemanag e
me ntsys t
em.

The
rear
et hreet
ypesofus
erwhopl
aydi
ffe
rentr
ole
sinDBMS
:
 Ap pli
cati
onPro
grammers
 Dat
abas
eAdmi
nis
trat
ors
 End-
Use
rs
1
.Appl i
cati
onPr o
grammers
Theuser
swhowr i
tetheappl
ic
ati
onpr o
gramsinprog
ramminglang
uages(
suc
hasJava,
C++,
orVis
ualBas
ic)
toint
e r
actwit
hdatabasesar
ecal
le
dAppli
cati
onProgr
amme r.

2.Databas
eAdminis
trat
ors(
DBA)
Aper
sonwhomanag
estheove
rall
DBMSisc
all
edadat
abas
eadmi
nis
trat
oro
rsi
mpl
yDBA.

3.End-User
s
Theend-
usersar
et ho
sewhointerac
twiththedat
abasemanag
ementsys
temtope
rfo
rm
di
ffer
entoperat
ionsbyusingthedi
ffe
rentdat
abasec
ommandssuchasi
nse
rt,
updat
e,
re
trie
ve,anddel
eteonthedata,e
tc.

Appli
cati
onsofDBMS
Ther
earevariousfi
eldswhe
readat
abasemanag
ements
yst
emisus
ed.
Fol
lo
wingar
eso
me
appl
icat
ionswhichmakeuseoft
hedatabas
emanag
ements
yst
em:
Fi
leManag
eme
ntS
yst
em

 Af i
lemanag eme ntsys t
emi sac o
llect
iono fprogramst hatmanag eandstoredatai n
fil
esandf olde r
sinac omput erhar ddisk.
 Af i
lemanag eme ntsys t
emmanag est hewayo freadingandwr itingdatatot hehar d
dis
k.Itisal sokno wnasc onve nti
onalf i
lesys t
e m.
 Thissystemac tuallystore
sdat aint heisolate
df il
eswhi chhavet heiro
wnphys ical
loc
ationont hedrive,anduse rsmanual lyg ototheselocati
onst oac ce
ssthesefil
es.
I ti
s
theeasies
twayt ostorethed atali
ket ext,videos,
imag es,
audi os
,e tc.
ingeneralfi
les.
 Dataredundanc yi shighinfi l
emanag e
me nts ystem,andi tcanno tbecontrolle
de asi
ly.
 Dataconsis tencyisno tmet,andt heinte g
rationofdat aishar dtoac hie
ve .
 OperatingS ystems uchasLi nuxandWi ndo wshasi tsownf il
es ys t
em.
Forexampl e,NTFSi stheWi nd o
wsf il
es ystem,andEXTi st heLi nuxf i
lesystem.
Theseoper atingsystemspr ovidelesssecuritytothe s
efileswhe ret heyhaveo ptio
ns
suchashi def il
es,l
ocks,andshar i
ngo nf il
es.

Di
ffe
renc
ebe
twe
enFi
leS
yst
emandDat
abas
eManag
eme
ntS
yst
em

The
rear
efo
ll
owi
ngdi
ffe
renc
esbe
twe
enf
il
esys
temandDBMS
:
Fi
leS
yst
em Dat
abas
eManag
eme
ntS
yst
em(
DBMS
)

1.
Itisasof
twaresys
temthat 1.
Iti
sasoft
war esyst
emus e
dforcr e
atingand
managesandco
ntrol
sthedat
afi
lesi
n managi
ngthedatabases
.DBMSpr ovide
sas ys
temat
ic
acomputersys
tem. waytoacc
ess,
update,anddel
etedata.

2.
Fil
esys
temdo
esno
tsuppo
rtmul
ti- 2.
Dat
abas
eManag
eme
ntS
yst
ems
uppo
rtsmul
ti-
use
r
us
erac
ces
s. ac
ces
s.

3.Datac
ons
ist
enc
yisl
essi
nthef
il
e 3.
Dat
acons
iste
ncyi
smo
reduet
otheus
eof
sys
tem. no
rmali
zat
ion.

4.
Fil
esys
temi
sno
tse
cur
ed. 4.
Dat
abas
eManag
eme
ntS
yst
emi
shi
ghl
yse
cur
ed.

5.
Fil
esyst
emisusedf
ors
tor
ingt
he 5
.Dat
abas
emanag
ements
yst
emi
sus
edf
ors
tor
ing
unst
ruct
ureddat
a. t
hest
ruct
ure
ddat
a.

6.Inthef
il
esys
tem,
dat
are
dundanc
y
6.
InDBMS
,Dat
are
dundanc
yisl
ow.
ishig
h.

7.
Nodatabackupandr
ecove
ry
7
.The
rei
sabac
kupr
eco
ver
yfo
rdat
ainDBMS
.
pro
ces
sispre
senti
nafil
esyst
em.

8
.Handl
ingo
faf
il
esys
temi
seas
y. 8
.Handl
ingaDBMSi
sco
mpl
ex.

9.
Cos
tofaf
il
esys
temi
sle
sst
hant
he 9
.Co
stofdatabas
emanag
eme
nts
yst
emi
smo
ret
han
DBMS. t
hefi
lesyst
em.

10
.Ifoneappl
ic
ati
onfai
ls
,itdoe
snot 10
.Ifthedatabasef
ail
s,i
taf
fec
tsal
lappl
ic
ati
on
af
fectot
herappl
ic
ati
oninas ys
tem. whichdependsonit
.

11.I
nt hefi
lesyst
em,
datacanno
tbe
11
.InDBMS
,datacanbes
har
edasi
tiss
tor
edato
ne
sharedbec
auseiti
sdi
str
ibute
din
pl
acei
nadatabas
e.
diff
erentf
ile
s.

1
2.Thes
esyst
emdoe sno
tpr
ovi
de
1
2.Thi
ssys
tempr
ovi
desc
onc
urr
enc
yfac
il
ity.
c
oncur
rencyfac
il
ity.

1
3.Example
:NTFS(
Newtec
hnolo
gy
13.
Example
:Oracl
e,MyS
QL,
MSS
QLS
erve
r,DB2,
f
il
esyst
em),
EXT(Ext
ende
dfil
e
Micro
sof
tAcc
ess,
etc
.
s
ystem)
,e
tc.

Re
lat
ionalDat
abas
eMo
del

Relati
onalDatabase:
Adatabasei
nwhi c
hthedataiss
tore
dinthef
ormofr
e l
ati
ons(
al
so
cal
ledtabl
es)
iscall
edaRel
ational
Database
.Inot
herwordsaRel
ati
onal
Databas
eisa
col
lec
tionofo
neo rmoret
ableswhichar
erelat
edtoeac
hother
.

RDBMS :
ADBMSus
edt
omanag
eRel
ati
onalDat
abas
esi
scall
edanRDBMS(Rel
ati
onalDat
a
BaseManag
eme
ntS
yst
em)
.S
omepo
pularRDBMSsof
twareavai
labl
ear
e:Or
acl
e,MySQL,
Sybas
e.
TOUR
Be
nef
itso
fus ingaRDBMSar e:
 Itiseasyt ous e.
 Itissecuredinnat ure.
 Thedat amani pulati
oncanbedo ne.
 Itlimitsredundanc yandr epli
catio
no fthedat a.
 Itoffersbetterdataintegrity.
 Itprovidesbe tte
rphys i
cal dataindepende nce.
 Itofferslo
gicaldatabaseinde pendencei.
e.datac anbevi
ewedindi
ffe
rentwaysbyt
he
dif
f er
entus ers.
 Itprovidesbe tte
rbackupandr eco
verypr ocedur e
s.
 Itprovidesmul t
iplei
nterfac es
.
 Mul ti
pleus e
r scanacces
st hedat abasewhi chisnotposs
ibl
einDBMS.

MySQL:
Iti
sanOpenSo
urceRDBMSS o
ftware.
Iti
savail
abl
efreeo
fcos
t.S
QLi
sas
tandar
d
l
ang
uagefo
rst
ori
ng,mani
pulat
ingandretr
ievi
ngdatai
ndatabase
s.

Relat
ion/
Tabl
e:Atabl
eref
erst
oat wodimens
ional
repre
sent
ati
onofdataarrang
edi
n
co
lumns(al
soc
all
edfie
ldso
ratt
ribute
s)andro
ws(als
ocal
ledr
eco
rdsortupl
es)
.R

Ef
er
ReRel
ati
onbet
weendatabaseandtabl
e
Fore
g.I
nastudent’
sdat
abas
ethe
rewil
lbeSt
udent
s,Teacher
sandOff
ices
taf
ftabl
esf
or
st
ori
ngres
pect
ivedata.

RDBMSTe
rmi
nol
ogy

1.Attri
but e:EachcolumninaTable.
At tr
ibute
sarethepr o
perti
eswhichdef
inea
rel
ation.
2.Tables–Int heRelati
onal
mo de
l,r
elati
onsaresave
dint hetabl
ef o
rmat.Atablehas
twopr operti
esrowsandcolumns.
Ro wsrepre
sentre
cordsandcolumnsrepre
sent
att
ribut es
.
3.Tuple–I tisnot
hingbutasingl
erowo fatabl
e,whic
hco ntai
nsas i
ngl
ereco
rd.
4.Degree:Thet o
tal numbe rofat tribut esintherelati
on,isc alle
dt hede g
reeofthe
rel
ation.
5.Cardinalit
y: To tal numbe ro frowspr es
entint heTable.
6.Domai n-Ado mai ni sas eto fpe rmi t
tedval uesforanat tribut eint able.Fo
re xampl e
,a
domaino fmo nt h-of -
yearc anac c
eptJanuar y,Fe br
uar y,…De cembe rasval ues,a
domaino fdate scanac ceptal lpossiblevaliddatesetc.
Wes pe c
ifydo mai nofat tribute
whilecreatingat able .
7.RelationSchemaRi sdeno tedbyR( A, A,A…, A)whe reRi sther el
at ionname123,
nandA, A,A, ….Ai st helisto fattribut e
s.123n
8.RelationStatei st hes e
to ft uplesint her e
latio
natapo inti nt i
me .Ar e
latio
ns taterof
rel
ationschemaR( A, A,..
.
,A) ,
deno tedr(R)i
sas etofn-tupl esr={ t, 12n1t, ..
..
,
t},
whe r
ee achn-tupl eisano r deredlisto fvaluest=<v, v, .
..
,v>, whe rev2m12nIi si
n
domaino fAo ri sNULL. He reni st hede gre
eofther el
ationandmi st hecardinali
t yof
therelati
on.

I
nthi
stabl
e,De
gre
eofr
elat
ioni
s3andc
ardi
nal
ityo
fre
lat
ioni
s3

Re
lat
ionS
che
ma-
(
cus
tome
rID,
Cus
tome
rName
,St
atus
)

Re
lat
ionS
tat
e-{
<I,
Goo
gle
,Ac
tive
>,<2,
Amaz
on,
Appl
e>,
<3,
Appl
e,
Inac
tive
>}

Ke
ydi
ffe
renc
ebe
twe
enDBMSandRDBMS

 DBMSsto
resdataasafi
lewhereasinRDBMS,dat
aisst
oredinthefor
mo ftabl
es.
 DBMSs
upportssi
ngleus
ers
,whil
eRDBMSs upportsmul
tipl
eusers.
 DBMSdo
esnotsupportc
li
ent-
ser
ve rar
chi
tec
turebutRDBMSs upport
scl
ient-
ser
ver
arc
hite
cture.
 DBMSh aslo
ws o
ftwareandhardwar
erequir
ementswher
easRDBMShashigher
hardwareandsoft
war er
equir
ement
s.
 InDBMS ,
dataredundancyisc
ommonwhileinRDBMS,ke
ysandinde
xesdonotall
ow
dat
ar e
dundancy.
KEYSI
NRDBMS

PrimaryKe y–Aprimarykeyisacol
umnors e
tofco
lumnsinatablethatunique
ly
ident
ifi
estupl
es(
rows)
inthatt
able
.Ther
ecanbenoduplic
atesi
naPr i
mar yKe ymeani
ng
thatther
ecanbenotwosamevaluesi
nthetabl
e.Wehavefewrule
sforchoos
ingakeyasthe
PrimaryKe y.
Theyare:

 Pr
imar
yKe
yfi
eldc
anno
tbel
eftNULLandi
tisne
ces
sar
yfo
rthePr
imar
yKe
y

c
olumnt
oho
ldaval
ue.

 Anyt
wor
owsi
nthet
abl
ecanno
thavei
dent
ical
val
uesf
ort
hatc
olumn.

 I
ncas
eaf
ore
ignke
yre
fer
stot
hepr
imar
yke
y,t
hennoval
uei
nthi
spr
imar
yke
y

c
olumnc
anbeal
ter
edo
rmo
dif
ied.

S
upe
rKe
y–As
upe
rke
yisas
eto
foneo
fmo
rec
olumns(
att
ribut
es)
touni
que
lyi
dent
ifyr
ows

i
nat
abl
e.S
upe
rke
yisc
ombi
nat
iono
fPr
imar
yke
y+anyo
the
rat
tri
but
eint
het
abl
e.

Candi
dat
eKey–IfaSuperKeydoe
snothaveanyduplicateatt
ribut
e,iti
skno
wnasa
Candi
dat
eKey.
ThePrimaryKeyiscar
eful
lychos
enaf t
e rc
onsi
derat
ion,f
romtheg
ive
n
Candi
dat
eke
ys.Al
ltabl
esarere
quir
edtohaveonecandidateke
yatleast.

Al
ter
nateKey–Outo
fallc
andidatekeys,
onl
yoneg
etss
ele
cte
daspr
imar
yke
y,r
emai
ning
ke
ysarekno
wnasalte
rnateo
rs e
condarykeys
.

For
eignKey–Fo r
eig
nke ysar
ethecol
umnsofatabl
ethatpoi
ntst
othepr
imar
yke
yof
anot
hertabl
e.Theyactasacro
ss-
ref
erenc
ebet
weentabl
es.

Exampl
e Tabl
e-Empl
oye
e
 EmpI
dist
hePr
imar
yke
yint
het
abl
eempl
oye
ease
achr
eco
rdwi
llhavedi
ffe
rent
e
mpl
oye
eid.

 S
upe
rKe
y-(
EmpI
d,Fi
rstName
)or(
EmpI
d,Las
tName
)or(
EmpI
d,Mo
bil
eno
)or(
Emp
I
d,EmAI
L)

 Candi
dat
eke
y-EmpI
d,Mo
bil
eNo
,andEmai
lar
etheCandi
dat
eke
ys

 Al
ter
nat
eke
y-Mo
bil
eNo
,andEmai
l

 Fo
rei
gnke
y-

Tabl
e:De
par
tme
nt

Tabl
e:Empl
oye
e

 Cur
rent
ly,
wedono
thaveanyi
deaabo
utt
hede
par
tme
ntsi
nwhi
cht
hee
mpl
oye
esar
e

wo
rki
ng.
Byaddi
ngt
heDe
ptI
dtot
heEmpl
oye
etabl
e,wec
ane
stabl
is
har
elat
ions
hip

be
twe
ent
heEmpl
oye
etabl
eandt
heDe
par
tme
ntt
abl
e.He
re,
theDe
ptI
doft
he

Empl
oye
etabl
ebe
come
stheFo
rei
gnKe
yandt
heDe
ptI
doft
heDe
par
tme
ntTabl
e
be
come
sthePr
imar
yKe
yfo
rthatt
abl
e.

Tabl
e:Empl
oye
ewi
thDe
ptI
dasFo
rei
gnKe
y

Co
nst
rai
ntsi
nRDBMS
-

 Re
lat
ional
cons
trai
ntsar
ether
est
ric
tio
nsi
mpo
sedo
nthedat
abas
eco
nte
ntsando
per
ati
ons
.
 The
yens
uret
hec
orr
ect
nes
sofdat
aint
hedat
abas
e.

Type
sofCons
trai
ntsinRDBMS -
InDBMS,t
herearef
oll
owing5di
ffe
rentt
ype
sofr
elat
ional
cons
trai
nts
-

Ke
yco
nst
rai
nts
pec
ifi
est
hati
nanyr
elat
ion-
 Al
ltheval
ueso
fpr
imar
yke
ymus
tbeuni
que
.
 Theval
ueo
fpr
imar
yke
ymus
tno
tbenul
l.
Exampl
e-
Co
nsi
dert
hef
oll
owi
ngS
tude
ntt
abl
e-

S
TU_
ID Name Ag
e
S
001 Aks
hay 20

S
001 Abhi
she
k 21

S
003 S
has
hank 20

S
004 Rahul 20

Thi
sre
lati
ondo
esno
tsat
isf
ytheke
yco
nst
rai
ntashe
real
ltheval
ueso
fpr
imar
yke
yar
eno
t
uni
que.

1
.Do
mai
nCo
nst
rai
nt-
 Do
mai
nco
nst
rai
ntde
fine
sthedo
mai
nors
eto
fval
uesf
oranat
tri
but
e.
 I
tspe
cif
iest
hatt
heval
uet
ake
nbyt
heat
tri
but
emus
tbet
heat
omi
cval
uef
romi
tsd
omai
n.
Exampl
e-
Co
nsi
dert
hef
oll
owi
ngS
tude
ntt
abl
e-

S
TU_
ID Name Ag
e

S
001 Aks
hay 20

S
002 Abhi
she
k 21

S
003 S
has
hank 20

S
004 Rahul A

He
re,
val
ue‘
A’i
sno
tal
lo
weds
inc
eonl
yint
ege
rval
uesc
anbet
ake
nbyt
heag
eat
tri
but
e.
2.
Tupl
eUni
que
nes
sCo
nst
rai
nt-
Tupl
eUni
que
nes
sco
nst
rai
nts
pec
ifi
est
hatal
lthet
upl
esmus
tbene
ces
sar
ilyuni
quei
nany
r
elat
ion.
Exampl
e-0
1:
Co
nsi
dert
hef
oll
owi
ngS
tude
ntt
abl
e-

S
TU_
ID Name Ag
e

S
001 Aks
hay 20

S
002 Abhi
she
k 21

S
003 S
has
hank 20

S
004 Rahul 20

Thi
sre
lat
ions
ati
sfi
est
het
upl
euni
que
nes
sco
nst
rai
nts
inc
ehe
real
lthet
upl
esar
euni
que
.
Exampl
e-0
2:
Co
nsi
dert
hef
oll
owi
ngS
tude
ntt
abl
e-

S
TU_
ID Name Ag
e

S
001 Aks
hay 20

S
001 Aks
hay 20

S
003 S
has
hank 20

S
004 Rahul 20

Thi
sre
lati
ondo
esno
tsat
isf
ythet
upl
euni
que
nes
sco
nst
rai
nts
inc
ehe
real
lthet
upl
esar
eno
t
uni
que.
3.
Ent
ityI
nte
gri
tyCo
nst
rai
nt-
 Ent
ityi
nte
gri
tyc
ons
trai
nts
pec
ifi
est
hatnoat
tri
but
eofpr
imar
yke
ymus
tco
ntai
nanul
l
val
ueinanyr e
lati
on.
 T hi
sisbec
ausethepre
senc
eofnul
lval
uei
nthepr
imar
yke
yvi
olat
est
heuni
que
nes
s
pro
perty.
Example-
Consi
derthefo
llo
wingStude
nttabl
e-

S
TU_
ID Name Ag
e

S
001 Aks
hay 20

S
002 Abhi
she
k 21

S
003 S
has
hank 20

Rahul 20

Thisrel
ati
ondo
esno
tsat
isf
ythee
nti
tyi
nte
gri
tyc
ons
trai
ntashe
ret
hepr
imar
yke
y
co
nt ai
nsaNULLval
ue.
4.
Ref
ere
nti
alI
nte
gri
tyCo
nst
rai
nt-
 Thi
sco
nst
rai
nti
senf
orc
edwhe
naf
ore
ignke
yre
fer
enc
est
hepr
imar
yke
yofar
elat
ion.
 I
tspe
cif
iest
hatal
ltheval
uest
ake
nbyt
hef
ore
ignke
ymus
tei
the
rbeavai
labl
eint
he
r
elat
iono
fthepr
imar
yke
yorbenul
l.

I
mportantRes
ults
-
Thef
ollo
wingtwoimpo
rtantr
esul
tse
mer
geso
utduet
ore
fer
ent
ial
int
egr
ityc
ons
trai
nt-
 Wec
anno
tins
ertar
eco
rdi
ntoar
efe
renc
ingr
elat
ioni
fthec
orr
espo
ndi
ngr
eco
rddo
esno
t
e
xistintheref
erencedrel
atio
n.
 Wecanno tde
leteorupdateareco
rdo
fther
efe
renc
edr
elat
ioni
fthec
orr
espo
ndi
ngr
eco
rd
exi
stsi
nt here
ferenci
ngrelat
ion.

Example-
Consi
derthef
oll
owi
ngt
wor
elat
ions
-‘S
tude
nt’
and‘
Depar
tme
nt’
.
He
re,
rel
ati
on‘
Stude
nt’
ref
ere
nce
sther
elat
ion‘
Depar
tme
nt’
.
S
tude
nt

S
TU_
ID Name De
pt_
no

S
001 Aks
hay D1
0

S
002 Abhi
she
k D1
0

S
003 S
has
hank D1
1

S
004 Rahul D1
4

De
par
tme
nt

De
pt_
no De
pt_
name

D1
0 AS
ET

D1
1 ALS

D1
2 AS
FL

D1
3 AS
HS
He
re,
 Ther
elat
ion‘
Stude
nt’
doe
sno
tsat
isf
yther
efe
rent
ial
int
egr
ityc
ons
trai
nt.
 Thi
sisbe
caus
einr
elat
ion‘
Depar
tme
nt’
,noval
ueo
fpr
imar
yke
yspe
cif
iesde
par
tme
ntno
.
1
4.
 Thus
,re
fer
ent
ial
int
egr
ityc
ons
trai
nti
svi
olat
ed.

You might also like