You are on page 1of 15

Unit-4 he rotabona dafa malo

Yelakoa dalabaeconPtang
DATE

-HOLPaneni
YRotalPonat Mode Conapls
KeladPonal madd epregenls The database a a
Colectfon ol relarons (e )tabe o vawe
ven0c0 fo fhe table eprelenis a Cole chon e
roiatod dada values The tdbe name CO lUMN_ Dame
Dre helpfol fleopret the meann el vwes
eaCh rotw The dala zre represented a a sel of re/2hons

abreshYelztrona daBa mdel, dala Ps Stored Pn


the tabe he table Consists anumber
Yous and Cou Thus, fs usd because Can
Yepregt the daBa t h e Simpre9t fo7opossbie
maxin dad7 reteval Ven 22y

oA+rtbote. Hny elaton have denide properhes


caTed as attrPbute

Tpie o u 0 able repreg ende he tepe twhith


Contains the dafa Yelo nd

oomaing P s a se eVawes thich Fs nonka


ie t s a sel of aC2pt abie vaw eg tha a
Col umn al0wed Contan ex be value
d a t e obhhh must be greaer than evo. Hs
tCann0t be neg aye. Th is czLed demah of
an f bule.

HoIaftn. A reiaBon în Yelatronal data mde

elasSMAte Vepresent9 the YeSpeei ve ttribute CoLn


PAGE L
behw on i m
Atribule
CCow mns)
DATE OI
Srodend
S-name Stuaddves Dept-id
Jo Naua Papa
Ab syyotm
12
Aarav Km
13 Ashna apa d 3
An Pokhr O

Nznfsh A anepg Topa


sSyang ja
Paima Cey atibote Pk)

Characterishcs O Yelahong
ach Yelabon n 3 dadabase Must
drstirtt O Unig ve nauMOChich Must have have aa
ro ha othin Yelaho ns fn cw0u rd 8ep arede
the
Aelaton mut not have hwo datable
ame name alh
aftybore
tPbutee w
Duplicale tupa9 mu ns be o have 2 dihntt nam
Eoch tuPle mukt have preenPnrelzhn
One data
vw
TUDLO9 a YQlaha) do not
gfanricant 0To a haue to ouo w) a
Smiamy he at+bute ThorUahonfsnot
Of a rel ordar-sena
Order-s ens
have to susu o do nd
S ncant ordon

clASSMAtee
DATE
2er aFonal Node woahon

ANe to)9u
wPM Ose
Oseol tOtw ng nota ion n oor
pregenlats
re lalPon schema Re degree n Ps denofed by
P(AJ A2, ----, An)
09 he UPpecage l ters ,Rs denote reiahn
The dwer Caye Lotters q. S don namG
The 0feeahon sBala
Hers tON donoHes tUplep
Tbe name a Yelaton Schema Such 2S S70 DENT ndicae
tprent 9e topl Tha relaton whereag STU DENT
Iuame, Poll,-) reers ony d relzon
schema
) A o aaibute H Can be q uaied wth tre rel zhon
nane P to whfch belongs by US¥ng The dot
notahn R.A 7 For e1ample. 3TUDEUT. Name, STUDENTAg

vi) An-tupie f a relaton Y(R) Ps denofed by


t v J ý 2---- Vo> W her e v Ps 7he value Coepondi
7o 2ttbufe Ar

Both fA and A ard Someina +013)refer


p fho Value V nb b o n a t b o te A on

Both tTA,Aw,-. - da E.lAo Au,-M) where


HorAd,.Az nefer
the J i of arbotes foP
70 the Subtoplo VUve Vo, h w - - V e o
Tr@Iponding t theatribule 9pecise he 4

PAGE
esSMAte
DATE IL N
Oatfonal
fon a Modol onstrafints anol0) ahona
alabale SChem29

eluhonal
elional Nodol Confdaints are relerred
ondons (hrch must be present or a Vid
retaho H Conraint on Tha relahondhtp datcbae
databae
manag emnt SySlem fs mosty dided en to the
main Calegom

omain Con& ratnis


O Kly Congrains
OREerenhz TiegrhyCongtrafnts

O omafn Co n&fraints
omafo con&d rantS Can be denad 2he dohn thn
a vaud set 8 vave or
type e dom 2iD inwd9 attoribute,ne data
an

mo dte, UTYen
ing Charator, Dtee,
ee The vawe 6f tne
mo&t be awaflaba m ho atribuk
CoTre8 Pondg domaih.
e we pen daia tpe Cheek bere ch?ch
meang9 hon we alI Fgn2a dala tpeto a
Cotemo, we Pmi dhe Vawes P Can Contain.
we a28ana dalape of ztoibole ae
ae as
COe Cap'tge Naue t h e han P aPot Pnt
Potdatatpl
to-fo w-ame
Jo Aoxi
Age
20
Arav
9
2 A -NGt UBIE
elASSMAte
PAGE
DATE
0 ContraTn+s

Ormys Koy Conddra?nt detl areg a colurn


Com binahon
a
Colormns CWhose vwe
unfquey donhty
2 0r

each row n a taba.


2 we Pnsed Updale a row that wou rd C aus e
o p i r c a le
e Pimay key,
dalabaje c 3s ve an
r meis p e
e
The K con gainE Speci bes hat the key atntbu e
Should be OnDQUC a nd
Shoord nover be olL D
S hould not be Same Tor two drfeaen t oos of data
S
Ed: Tn betotoabe Cwgtormer TD a
kuy atTbute
oL Cw&omer tabe T is mo,Pke To have a
Sing e a singe Custome, e Cos tomer TD4
s onIy for he CtDMerUame: "w Qale '

CutornertD Cu&tomerName 84 ahs


ro e Achve
2 Hmazon ACA Ve
3 App a n a ch e
imzil
Kayconfiraint VoieBs

efer@nia ToBegrhy Ccnf4r ainds


A vena inleriy Conma int s speciged behueen
Conghrain
table Tn the releren #a nteai
tabu Vefers he Pr mamy
foreian
elAsSMAte
PAGE
DATE

OyOO table 2 then euey


Vawe ' Of The fomrer
be null or oe
be av artabo
avau taba
ey D tab lol muA
tablo 2
Acos ccoes 1So1SV92odchrieo
nampe
CYE
Student. Tepaement
Stud StU.nameDeprd Depid Dep_nane
o Nya CoTputay
Ankit sod 2 Hath
12
A bi
J3 Aan phybr
Oot aue wed a9 Deptpd
etsob fs n ot dKnad a Priary e
e abe
Depatman,Dept-no fs a
retn kry deknad

clASSMALe
PAGE
DATE IO
otahonal DaBabaye &Chemag
molalPona databas e schema helps
and Undeastand h e
yoo to
Omani
2e elrochwre of dasakap
paticulas/y Osef wben desan Png a new
lalabae modPyngan ezfeting clalabasë to Suppod
more twpctionau or bu ldring fnBeg raion be
databases (Trelons fo how daa s Or anized

Fommaiqa re/atPonal databwe schemna 2se


Oreladon Sehemag S S P ,2 2,-.- - - . Pm y
hy Co ng1rain-s A reraio nal databage Stale

3 a set of relahoD 8tates DR TsY2,- ---, Ym


Such that ezeh PPs a 8fate o P ? and P reiahm
Statao saks y te ntegty Consfraints

speehe Charatemish thah be ars fhe Same


F one
realworid concept ma appea m eme
Than
Yelzhon&hp Tth The Same 07 a derferent name
émploees relahn, m ptoyee Id S represak-

Tn Vouchens 23 AthBy prep ly


thaf appeas
Tbe Specsc real-uwoMd ConCept
rMore THan once n 2 YelaHTons hp &hourd be

epres en tes by derent name


The iHeayiy Con 3 t a Pms t h a me Specfad on
database &tate
dadabge gchema shal apply td e v e y
t h a l Shema

PAGE
elAsSMAte
DATE L

rsok 2

Entiy olegTty Rerahona! integit


Foren and

Eobhy integty
ho entii inteprny tate that
S no
Uawe an be ULL. ThYs Ps Primay kuy
Koy vawe 18 ured7o becaue ThaThe poMay
denhy
fn the aboD
Hawing UtL VOwegindiuidual eypaetp
By Ympite ha we om
Cannot Prima
denhfy Sme fuPC
fupls hao OLL
Primamy Vys hen we or thef
may no be
@b to
YEineufsh them we my to
than e Jahne referen ce hthom

elAsSMAte
PAGE
DATE I
Dokeyaoh a l n t e g r y
ConS r an

The melerre ntial indegity oninaint 3 Spedhe hehven


elarors 3 ased mafn tain the Consft Fen y
hwo
tuples fn The tuo relafrons
amog fho
-Pelerei'al ThHeg vity ConStwaintupfa ly ar ise fro
he re laton gh p s among The entrhes repres en ted by
the rel2h'on SChem

ConstoaintiS Compu/s ory hoo ogh fomeign key


Thfs
/he V 2w frelgn ku o tople orelahon R
a

Can ef fheo take The vawee of the Pmmany Key for


relahon 22, O Can a ke WULL Va we
Some twple in
but canlt be erPty

ore fgnkey
Pn the able Thaf fe primary key
T s the rerd
mayzceep
Oan0therr able. A egkay
2n0f automa
MulbplO NULl U a w .A fone key
O non-ctoStere
non-cieSfew
COsteres
aninde,
+rcauuy
C ay Cae ae
ere ate 2 n irder
on

HOweueY, We Can manUauy


Tn he
oe have m1Hple
tome 9n keus
reran
tab

PAGE
DATE UN
Ontopt o fnsert, dereBe and upd'ade operaf
LDeaino wh Constrafnt vorahorla)
There are three basfc cpeations ha can
he Stve erations the daabase, Tnser
Cha
detoteOr opodale lmody) sert,
COhen ever theg e
Operratons 3reappired The nteqrT Constans
Speced on the relatonat
dalabase Schemha
8houd not be Ufol aled.T thPe
dscas he types sechon, we

No1ated bu ealh ef thesenstrafnts that


y
may be
the stype
acFons 7ha may be apevatrong
ken
Cause a v?O iaton an opera

O
be Insert_ope at fon

n s ert operahon Ps
More ne Foples inbsed to Tnsert one or
relaf a
povd es a ISt Of
new tupie t thal s toattrrbo
be
te vaw
Foa
vel ahon insemBed Fnto
Doman Constrafnis can be
atribule valve Te aven vibIated P an
that does nO appe
he Ca Tregpond fna
soma Om not
ppmp riate data type he
Ke Cons-trants Can be vio
laBd 7 3
the nea upie E koy vawe t
aIready etfsts T
the Yelafon R a0other tupte n
Leterenha foteqT?hy Can be vfoiated
2ny toreian koy elers Ho atupiethe
tha4
VZlr e2

oesno+ enfs ?n the


clASSMAte Veterenced relzhan
PAGE
DATE OD

e Depardmen t
8310Sta
Dep. td Dep.name Dep bio Ckuno
Commputer Joe
Staf-rdsBaflnae
JL Hohan
tepir
2 Nah 900
30 o
92 prahroa 2
3 Co nomiO 33 Modan
4 neAccount Yo0 h ysn kanala 3
S APhysig S0o s ud Sandhya
66 Umerh
3
pamesb

84al we cannot a0d, nao


Teord6," Engih", ury S
be cas V awe
ba*r7boBe Depl-broten syPnte er
Pe
Which vTo 1ate9he do main Conira int
> S 7 i lacly, we Canno fnset a heo recod 4,
Cngish", Foo to dep adment abe bee avs e he
ey vaue 4 alyeady exis Po the Depamend table
n d we Canno+ fnserhe neLw retord, J2, "Ank?", 6y
to 3taP tabe be caike their reerenee was net
Presend a Dep aeBmen/ able.

he delele opevatfon.

Deete perach on s osed fo delele tuples


o n a 7ea

Can VolaBe oniy ve/everdial nteg ?


O CLrS o p le befng develed s elerences by
ren keys 1Drm othertopreg the dalab2/e.
Condon the tTbute
S p e c f u delet , a on

| t h e labn se eets the tupie h be dereles


delele Vecord ,Compue
h ab0 Ve 7, We c amG
h e i y yefen era
clASSMAt0 o) on depantmend tabe a PAGE
saN ed To Thefr Chiel b a Sorby deretry th
Pt vfol ate orelgn cey Conlra inl
DATE UT

h e update Operation
The vawee a
to Change
Opdale 0peratPon is Uged
e4 9omne
8some
Some almPbute8 Po exfet tupl
felabon R. On th
Condihon
necess to specy a
amy The tu preo be
atribut@ of the reanan to serect
modPped.
Change t h e elend
S In above e e Cannpt
S9,"Compote') beae
d"Compufer" 1oot t
his reer ene 9avedto h e Chid a b l e elay.

Concopt of Trang actro.


trans a Chon fs an edecwbrg Pogo that
nCwdao Some dadabaie operarons, SuCh
Yeing ddabae, 0T appiun nser tons,
dol ehoror upd zte9 o The daabae
A databas e appifcahon pmram
Yunn'ng
ains +3 relahonal daabue typicaluy eUe
One 6r more Transachong
) P h e end of the rans a Chon, ? must leave tu
data base fn a Va Pdo Cons istent State
th at
Sab's hegz he contrainis epecled on the
alat abuge scherma
tarope AdTans acKon to 7pply a bank withdra
Cwf typicalny read he use Ceo ot
record, Cheek
thene a Sufr ciend
balan0, 2hen opdate the
record by sthe WHhoasw 2nOont"
clASSMALe PAGE L
DATE
Advantages o usfng Pel a/fona 1Modor

s more SFmpier than hierarchfcal and nekoo mode.


3 Concemed coSPth dala vather than tructure so this

Can im pm vethe penform ante af mode


Of roa3 and
4 easto s e s hce t2bies Conssst
Ps
Co lomns s 8Fmpie fo ondeT Stand.otos
P s dala Tndependan@ Sce ruchore of danbape
Can be Changed wthoot hay?ng to Change anyppiCato
m a kos Poseibe f o htah leve qve angoe e S4

avoTd Comp/e daBabase naviqaba

Dsa dvantages Ostnq Reiahonal Node

daBabases ha ve s reid lengtts


Few rei a4Po nal
cohich Can't be exceeded
aBabase Can Sometmeg beco me Comple as
Relatiena
the amoont al daa arous
yead so/adel
CoDpleu Yelahonal datzbaye SY84ems
databasa C bere h e Tnfomadon Can beShmed
one sylem t anether

cu 15 PAGE
elAsSMAte
DATE

DEeren ce berweon Tnt egohy secwn

Secui-h

Dal a Secwrity defnes )Dala Tolegafty dehne


The pre ventior d a t a The goaiity dat a,
d:
Corop1fon fhobegh the
tha
h f e h go7 Yan Lees tho
Se o Conto lleaUeSS data CoropleBe y hag
meeh an sms Cohole S/yuche

f DaBa Sewrin de ais 7)DadaTnterPty


wOththe poechon efdas deay with The
vaiidih d
data
799) Makirg Sure niy ) P making sure he
FhePeo pe Cho shoud dala fs CoTreel and ne
a v e a Ceees to h e dan
CornUp
me he oniy Onag h o Can
ee1s Tho dra.

Trelers o making relers to the &ruche


Sure Tha dada Pe a dalay how 9t match
2Ce egsed by Pls fntendod
Hhe schema e-the dattaba
Osers, Thos ensoming
The priVaLy g proyeeN
edata
N) Some eang odata U Vackinq up daBa,
Seusrih Authend cajon/ despin Suflable UL_
uth or2alm, entry phou emdelelnCoTreekacE
elAgSMAte
dada ane Some mezg
DATE
Cues+9ons agked farom-ths chapler

.Delerence between fotegfhy and sewr?ty wth


enamplo 209 S mankg)

. h a l ntegrityCaplain different ypes e


THegri (203-s mame)
De'ne Totesity congdraint ?Diws domain conrain
with goPabl0eNarople 2090-SmaM)

n e refeenhar ?nBeq rihy coth exanp G 294-Sney

DEs aken care ethe d aBa


h feh pat a
diobona 2 3 Sma ne)

elassMAte PAGE

You might also like