0% found this document useful (0 votes)
13 views16 pages

Dbms 1st Unit

Uploaded by

maxwelshelter
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)
13 views16 pages

Dbms 1st Unit

Uploaded by

maxwelshelter
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/ 16

tabase A Darabase is an oxgoni1e4 tonetHon e su cuitd infosmarion

0 data , Hypicaly dhorcd tlehoni cally in a Lomputer system,


A Database is usually tonHoled by a data s e management
system ( Dems).
The data can then be easiy aleerfed ,managtd . modified ,updabéd,
ton rolle d and 0194i2 e4.
Databasc System_ALchikeckure
The Denms deign aepends upon asthitehufe The basie Uient |server
aschitethure is ustd to deal wih a largt numbes o P s w t b st1v efs,

databae SeNe YS and omer componenrt h a t aTL tonneth ed with


ne HvOSKS.

DBMS avthitetyre

1- titr 2-Hes 3-Her


arthiteuse
arhit
thitedkuse arthiteHyre

-Her Architeckre
In this arChittdhure , the database s disecHy avai lable to the use
means he ustr Can dire ctly sit on he D8Ms and uses it
Hoy Changes done hese wil directty be done on he data base itsey Tt
doesn't psoride a handy tool end s, Jor usts
The t e y arthibecure is used or dev elopment o he ic cal applicahon,
whese P1o9 rammeri "ean cliretHy tommuni tate wih e datab4se (or
he quiek resp onfe.

-Tier Asenitedure
The Tie arhitelkure is SamMe as besi. chhent Seves Tn m

UD- Her arthiecuse, applitaHons orn the cient end cen direchiy

Communtate HiHH he data base at th e seives Sde Foy his

interatHon ApT KeDDe JDOL are Mscd.


a1e TUn on he client -si'de
The user inter taces and applicaion proqams
The serves side s provi de he Aincti onaliHes iKC .quexy
Hesponsibie to

P7ocessing and Nansachion manage menc


estabiisnes a
Communicate wim Hhe OBms ,cient- side applica Horn
Connectipo with me seyver side

Database Sys tem Serves

Applica tion ient

Uses

Fi' ties arthi be chuse


33-TiesA1chibecHire
The 3-Ties atunitéckuse Contains, ano he tayes bekween me dient and
seY ves In this, astiteuture uien't can't diseutly tommunitate
wih he sesNes,

The 3-tier ar thitedkure is used in case c 14sge e b applica hon.


-
The application bn he cient -end intesatts i tm an appicahon sesve
wniun urmes communitates oi h the-datqb4se System.

DatabasSe
SeNer
ApplicaHon
Sesves

ppiaient Ctient Uient

User
Data Abstrattion

view leve
view-i view- iew-n

logical vitw

Physical itw

Thte Levelt of data qbshautim .

how the dafa


Physical Level The towest levet oj abskation destsibes
0s oLtually stored. Tt de s(ri bes tomp1ex bw 1evef data -

Shutres in detai.

Loqial Leve Nett hiqhes ieve o abeNacion descri bes wh4t data are
StOTed in me datab4se, and what vetationsni p eIStS

among hose data.


Deslibes entise data base in terms mall numbes o5eloi vely
simple Sucres.
vitw leve he highest lerel
oj dbsa tHon des cribes only Part o
enhe data b4 se. Many stss o h databGse, SuShe m do
not nted all hett ntosmaHon , Lns tead, thêy nted to
auess a
p4t he datab4se.

user
Data Todep endene
View LeV et

hagita! Data Tdependence


&ontepkual Sthtma
4 Phsical Date Tm de pendence
Pnysico Schtma
Dat Inde pendence is deined as a piopesty oDEMs }hat neips yu to
d n e the Datadase suhema at one level oa datab4se sy¢ED
ihout
equir\nq to thanae. he scema at the next ni9 nes
evel. Data Tndep
endence nelos you to Keep data sepesa ted psom
al Pro qsams Hhat make
use oit
e
Change anything in
?nysica sthema it doesn't
Sihema due to
alet tonep Hua
Physical Data Tndependence.
endnge anyhinq o concepHial Schema it
Leve due to
dotsn't aleVe
tbgical Data Tnde
pendence.
Data Delinihon longuage ( DDL)
DDL S+ands Jor Data Dejini hon lenguage. T+ is use4 to
detine databasE
SHure or Pattein.
Used to Cseate sthema , todles , indtnes cons rojnts ekc. in
the data base.
uSin me DDL Sta kementsyou can cyeate he skeleton afme
database.
Data De)inition tanqu age is used to stose he ino1manion eetaolgta
tixe the number tobles and
scnemas,meis names, iodedes,
Columns in eath table ,wnsrajo etc.
Create T is used to C eate Objetts in he database.
AIter Uis uStd o attes he Shru chure a he database.
DYoD is uSed to delete objecks som, he dotabese,.
Truncate' is used to
Te move all TeCDiels 1om a tod|e
enome T isuStd to 1enmove an
dbjrut.
Comment i s used o omment dn he data
diionaty.
Data Maniputa Hon language (DML)

DML Stands o Data Manipylation 1anguage T , is used tos alcessin


and man pulaHnq dat io a da to base, Tt hand1ess use equests.
Here aYe come basks hat come under DML.

ehieVe data som a Dgt abqse.


-Select Uis used to

U is used to insest data nto a table.


Insert'
within a toble.
dote is used to update exising data
eto 1ds T0M a tabl.
Delete Tis uscd to deltte all

tpesor ms UPS E RT OptraHon i: e, insert os update .

Mesg
u a
CAIl T is used to call a shuctured 9guesy anguage
Java pr 0gtam

Exp1ein Plan T has me pargmeter a explcining ata


LO ck Table Ttonols ¢onuuJYeny.

Data Model

Eniy Relatiog chip Moce (ER Model)


ER Model stands l0r an Enty Rela Honship Hodel
T isa hiqn lev
me data elements and
Data Model, This Model is used to depine
Hla hons hip os speified cysteM
Compontn o ER diassam,
Eni
2 Attibutes

3 Retationghip
nti y Entiy Means anj Dbjet in ouf Databog e. CenrPt rson)

2Rueronship Nny veib whicw We ofe 90ing to be


dest1) be.(4ssociav'on)
Rttyibute is used to destri be me Pi*perhy oa
33 Atbyk
En tiy n Name, ast)

EnH pe
6RSoN name ge, add)
AtETinutes
m o s e attribute w e h a v e me b e t t e r inomahon we e t -

Composite vs Simple attributes orhe


-
tomposite o mp osed o many

TCan be
lur her -Tt can not be lusmes attributes
ost
divided. dyided ,wnín
Repsestnted by elipse
Conneuted wim au
Compo shte is a tellection
simp1e attribute,
E Pesson
Comp osite
attribute
be cavse
it is Addeess Piont No,
Name age
r h e r divide d

irst Miade Last


NGme Name Name

Simp1e a ttributees

not divide4
because it Con
u sther,
Reprcstn+td by d b oval
Sing1e vatued vs MulHvalued attvibutes
n h i s we have o T his we con assiqn more
OSsi9n ony one value i a n one voju

Age E Phone No

pesson Can
Aqe o a A pes0n Can hav& m o r e

vale. Pnone no.


naye onl in4I¬ than one

eesived attridutes - derived rom ongtney attn bute.


StoTeA VS
Pepreente4 by do she d eliOse
Tmedns he a ttii bute
Ya lues w h i we have b
Whih
We nave to s hore derive only.

Ex Do
Date of bA
Comphen ottvibutes '

ase Composi br n u v a lued as w e .


Tne a t t i butes wnih

hes Relahionshi p
Employce Man4eS Dept
ase
Oone to one e T)

6very Dept. should have a

manageY only one employ ee dz


manages a dept.
and an employee Can manege

Only one Oept


Deqree ol RelaHon ship No- oenH Hes ate ?asM cipatinq
So, Heve h e deq1 ee o Retohion ship
S 2.
Reanonshi
ps

Cardinatiy Ma imum numbes oTe) anonship 'in


Lnith eath eni
M D
can pavtiu p4i ng
Here cas dinalí y is
Parriupahon

MaMand Min.

One to Many Car ()


MA Mmployee Works DepartMent

RA: Every employee woikS or fo

exaHya Dept and a Dept. /er-


Can nave many employees. 3

New d ept neéd not hav¬ d


any employe es-

Mn

Dret
CdineihReHo Man oo o TUaHonship 1
PGrHupake
Whjih on en H La
S ur
DnShain Parheipa H1 Min: no. of Ttlurionshi?
in
"

eitnce hhi n tniy n


PasHupake
emp Dep or ho tal
N
Pashipaio

ai PaTHipan0

Min anct man. Re presentation


Dept

(o

Many o Many em1oyee P1ojeut


Pie¬z, e3
P2 e2 ,eu,es e3
P3: es,¬
P1: ees, e6 e
e

CAsel
M

Deqee Here itis .


Casdjnaliky tmpio Poet>M
Pa ri ipation **

wor o Projetr
M M

woryY Pra
C U,) (,")

ManMany to one

Sudent
M
EnYo corse
Notatons o&R Diagram
fompa ny
e

one lo many (Mondatoy


m0ny
6ne oy many (mardalov Employ e
One and only one (mandatory
Teso & one (ophona)
Teso s many toptional)

List
i. Cniy Type
). weak Eniy
w). Reioienship

).
Tdenikyins RuaHon ship
v). AttTibute
vi. Peimary ky
i). MulH valued Attribute
vi). Composite At tribute

x). Derived Attiibute -

x). Tota ariipation o


¬zin E l
Cotdinaliy E J
Keys ina Retation
allows us to ideniey o set
o atbri bu that suite t
distinguicn entH¬S som each olhes.

TPe of keys
.Sue keu St o one oT mose attsibutes har alle ws idenhfying
an entiy uniqutly.

May Contdn exo attsibut.

s d - i d ,std. name
n. Candid ate key o Supeskey hich Can uniquety
It
TS
minimal set
iceoi an eni
E std.id
Can be mose than one Candidate
Pic hosen by ihe, oeA ag me prinu pat means odeoti sying
entitg.
i) AItei na te key Composite Key Psimo fy Ke
) . Secondasy Keu Mainty used or data 9e esival
used in h e Cage o 91oup by
vi). Foseign key atliibute whose alue match the Primasy KejI
Tis a

in h e Huoted Toble.

onposile Ke* Combinaton o teo os more tolumns in a tasle,


Unauely idenh fy a ple.
En' S aust -id, orde-id y
ER Design Tssues
use Eni vs Attibute
w e ao mistaKe wnen h e uses uie he primay key o an ènng set as an

attridute anothes enty set. Ingtead he shmou ld use he selanonship


to do SO

Primasy key attibutes ase implicit in HelaHonship set.


Shudent [Nienond OPhone.
use o Eriu set s Relahoo shiq Se
Stadenth taks tourse

Student iser A Coufse


Child
Mother nny
Pastnt Rathes
Child Pa sen t|
Binasy
Chihd KHothe Portnt
Not n ed n a t te use
binas 06
*Exteoded ER FtaHures
0m a higher
Genevaisaion evet Cembiné. te
oLoes
more enuHes o
n this kuo os
attributes
n tommon
nave some
enH
evet i hey
TtiS a botton up a ppsooch
combined to losm a mose 9enesali2¢d eoti y
Tn genesalisahon, enitie are
that is Subtlass ave tombined to make a
supes ClasS.

(colege -Oame)
Person
MBes
(mobile
MD
Ms)
Sudent Physician Suvgeon
Fauliy

2 Spedlisaion
h i on hiqn eY eve ennH Can be broken down ioto two lower \eve
enhties
opposite ol Genevalisahon.
Top down apps oah
i s used to identify subset o an eniy set that shases <ome

dishnguisning chasatteysihts(olege) name

Employee MBes
mobile

(MD

Tester Developer Physiuan Surgeon


3Aggregation
n
aggs eqahon , the. Aelaion blw too ennH es is H eates Os a si
Ng1e
enhy
noagy egahon with i
lorsesponding entiies is aggsegad ed 1nto ""J"
1eve enHy.
centey Ktt Couise

visitos
ASSOaatton
Relahonship bekween too obetts
deines he muli pliy blw objeurs i n e an
assouahon
ossouaíon

ha d
One to o n e fo manu e tc, ace. all these
wosds

bl objtds
EA AA Student and a (awlty ase having on asso da Hon.
Neook Mode
cXension o Hieraschi cal Model have mose
nan
oe
pa5cn
S is that ,
mis Can
Ilttence
0 YLhitaf but
di

e gsa pn onlik Hie 1aschica ee.


Lolleoe

Librasy

StudentY
-Feaures'
Abiiy o mesqe moye Retahonghi ps
2 to <ame Tetoscl
Many Pa hs Moye than one pah
-

c2. in Ddel
Cirula Linked List Tmplemented by
-

3 Dbitur-utlahonal Data Mode


tombinahon o a Obje th osiented dqtabasse
An ob)ett telaHdnal mode is a

mod and a REIaHonal database mode, ThSupposts 6bjetts ,asses,


data
nhtritance etC just like o bjeit osient ed models has supposts for
+9pes, tabulas s u h ses e c . tike Relahonal dota mode

Advantag es o objett Retational mode)


The dbject Reahona data model allouos S Usess to
Inneritance
hest objets, ta bles etc. so hat hey can etend meir

funuhonali, Tnnerit ed olojecd s contains ned ottyi butes as


et au he attsibutes that were ionesited.

Complen dota yPes Can be formed usinq exishng cdata


Comple Data Typel'
+ypes. 1his is uselul in objett setaional dato model o9
CompleM dato ypei alow bettos maoipu)ahon o the cla ta,

3 Extensi biliy The funttionalik o h& sustem Can be


object extettd in
Hloional data Model. This an
ahiev td be
comple usi nq
lata yPEs as s as advanted tonepH oobjeit oricnred
modet SUh a nheitance
Disadvo ntages e objecRelational Mode
e obicct seluHonal data model Can get 9uite tomp i cat ed ond ci ffiwt

handle at nmec as i 1S a Cembina hon e me objet oritnted

data model Cand Redo tonaf Cr od nd


utii2 es the functiongdihec
oboth o mtm
nteari Consialn*s

Tntegrity Constsa'nts ase a set al gules. t i s e d to maintaio he

qua i o intorm aton.


ntgiy (onthrainls ensuie. that ne data incethon,updatin and
olhes protesses haue to be peromed in suth a wny that data

integvi is not
alected.

Tnteqity consraints
** T *

Domain
ConsTsains
EnHHy Rerenhol Ky
integsiyN integrij ons ainB
Consaink| Conssalos|
Domaln (onstaints
Domain tonst qin s can be
delined as he delinition aa valid
values os an o
attsibute
e TD NAME
To M
SEMESTtRAGE
St

Sonnsonn nd 24

Kat 3

Mor gan 8 th

Not .Becuse Aue is an ioteqers


allowed
attribute
Entiyinbeariy tonsttai nt
ine toh ottgsi ConshHaint States hat psimasy Key value Cant
be qull, EMPLoy ¢ E
EMP-TD EnP-NAM SALARY
23 Jaik 3000 O

A42 Ha6y
6 M 3o ho
Sauk Son 2+00o n'E00tgin a null value.
Reerenta inteaslty tonsains
E N H a ntegrik tonsiahnt is speti (ied betloe en tuso abies

ForeiAn
(Table
Table )
EMP-NAMENAME ACE D-No ky

Jauk 2 0.No. 18 is no
Nob allowed as
table
2
Haity L4D deline as a psimaty Kty o
in tabteL 0-NO. isa
3 Jonn 2
2 and
18
o eign Key depinetd
Devi 38 3

Relai onsnrs (Tae


Primasy k DNo D-LOLATioN
Mumbai
24 Oelhi
13 Noida

Ke ons faints
KRs Ose me enhiy set that is used to dtahfy an enhHy w1hin
enity set uniquely.
ID NAME IsGMESTER AG
ToM

oo Jo HNCoN 2d 2.24

co2 Leonaido
to03 kate 19
o02 8h
Horgan 22

o t allowed Dec ause all sow must be unique

SMapPinq Cons Yain


A mapPing consbaint is o data ton s taint thor erpresies the numbes ol

enti Hes ho whitn onbtnes eny Can be velatd via a Yelationship


Set
T i s most usel4l in desibing he sela ionship ses that invo|VG, more
than Jo enisets.

one to one ( 1 ) Many one (M, )

Oneo many (1M) Many o Many MM)


DJevente btween 0ems and Rle system

Basis DeMs l e Sustem


The fie syshen is sofkoase
ShuduTe The dems is sofuase tos
that manoges ànd oTganizes
Managng the datobase.
he file s in a sto 1oqe medium
wthin a lomuter,
Datq Redund ant data con^be nob
in Demns
pre Sent Rtdudont data can be p1esent
Rtdundanty
in fite Syshem

Batkup
and rovid es ba tkup and Ye Cov e Tdoesn't p1o vide batkup
Retove tN of data evcn ie it is ost and
recove1y e dota if i t is
loSt
Query
Piocestings E}}iuent quesy Processing is These is
here in OBms
no
e{icient query
psocescing in file system
Consistenu There iS mose data
lonsisteny 7hte
These is less data
tess Consi stenu-
belause o the Psocess
oj in the file s4SHem.
nosmalizaion.
6 (ompltxiy T has MOYe (ompleiy inb
i s less lomplex at
handlin q as
compased o he Compased Fo 0e ms.
Ale sysHem .
3 Seuri
DeMS nas moie
onstaiOs secuiHy. File sstem has tess
seurikH

& 2 Cost ismore epensi ve is ess


3. Data
exptnsiv e.
Tmere S 9 d ata
Tndeptn
exists.
independence is no d at a
dencee indeptndente.
Usex
MulHP1e user S can oet ess
Access Onty one uSe CaN access
dato o a time.
data ata a ime,

You might also like