DBMS 3-Unit
DBMS 3-Unit
DBMS 3-Unit
1 MaK.
what ia Deonpoi ton
Decomposi#oo DEMe s used -to break a relaticn Tnto
PositOn:
Nornal Form.
muitiple elatioos te brirgt 1nto an approp îate
heips to reduce vedundancd, anomal?es and inconsistencie s
t
then ft nay lead tocthes
elation fs mot ppPelu decomposed
Poblens fke fofomatlorn loss
Detine unjon operator 5 example ?
Ans UNION lu):
Tnstance contanog all tuples that tcn in e?then
returns a relaticn fstånceS o both
elatfonal
eiatin înstance R Y
S
S.name Ratioq| aqe s-1D|5-Agene rateng age
3s
Dustin |45
31 Rusty
S8 Rusty 35
44
fumpy S
3S
puppy S8 35
6-1DS-Dame
Dustin
3t
Rusty 35
44 Cumpy 3S
S8
pupry 3S
Deine nibrmatgatn?
yommal igation: Nemalizattoo 1s a prcess oB manânig in9 nedundaneyroma
Ans nelation ba a set of elations
may cause tnsevtion, de le tiong up date nomalies
+Redundancy in a nelation
60.it helps to heduce nedundancy in nelations
cohat are he types Aggregate tuneto ? petomealeulatfons cn
Agqregate-funelons : An Aggegatee-functfon in s6L
ans and oetums a single Val ue
malttpe Values
Ag7eqate -unetiens::
Tyees cf Aqgoeqate.
MINC)
COUnT() S8L
MA XC)
-function
AvG)
s)
cohat s Nested aueyy?
that has anothex
S Neséed Sueny: The nes ted quey is a tte
embedded hn it
quey
athe enbedded quey s calied a subquer Y
# Consists of tnN, woT IN,exST, NOT ExIST operators
SMARks
Descybe a sQLQuey wfta example ?
Ans Tthe basie tomD a SQL query is as -follos:
Select Lst
sCLCCT (DisTINC
FROM fromist
dHCRE qualification
must have
columo to be vetained in the
SELECT clause Whicbspec?fies the
nesut
he table
FROM clause which specfes acDSS Producl of
mentioned in FRDM
NHERE Specifes selectioo condft?on onthe abtes
cËause
DiSTINCT - Can be usedto relun only unig ue Values .
ex: student
S-name
Ram 18
2 Ravi
3
Raju
Ram
Select DISTINCT S.name omSdent:
output:’
Ram
Ray?
Raju
wnite about databaye anoma ies ?
Rav? 8
HntaY fo 1s AOT wULiy select columnname from tablename
WHeRE Colum. name s OT ULL;
SX* Select -x -from stUden HERE 5.emål ?s OT ULL;
olp:S.ID S. name S.age S-emal
ABC ABC@gmn£l.com
30
Y3@qm£il.com
9
4)
Raju Rajuqmai.co
are Ika bakic SQL Commanda wits enample.
Ans Basic SeL Cornmandsi’
de-fne a
C}CRENTC TAP LE: The ceatetable statemeots used to
mEw table to Create the se udente xelatioo e can use the
toncutg staterments
OPDATe Comand
Afsha mantding
Productfo 64,000
Bhuvan Prpducton 60,000
Ha REr D 60)000
Pseeth?
Mank Manteling NULL
Ans
) oNIoN(u): (Rus)
all tuples that occur
netmsa relatioo instance eone.o fostance So
0 efthe nelatfon s t a nce R O
both.
example:
S-NQme S-1DS-amne
S-ID
31
Rusty 35
Rusty
44 |qumy BS
58
Puppy 58 35
Susa S-Name
Katog
Dustin
Rusky 35
3S
Gumpy 35
Dustin 45
3
Raju
chya manks int)3
Alter tabie studev add (S
Std-name Std.age S.man ks
Ram
Raju 19
3
shyam
mop AItey table stud dop columo S.manks,
Select * om stud;
Sedicd Std.name
Ram 8
Raju
shyar 20
IOMARKS
fgge ? Explain kos to Pmmplement tigge
what is r
SQL.
feh fis autematicatl
ins Tiggess : n Thigge is a ppcedune oh to he dalabase
tnuercd by the DRMS 9n vespen6e to hanges
andis spectfitd bs the DBA
A database oleha sel of assec faled f93ers is
caled an QcLue databa6e
Pants of oqge databae ohfch
is a chanqe to he
Ca) event: An evenl
actiuates the
aoher the
(6 condieion: Aquery o
aceivaled .
(e) Actéon: A Pocedune -that is executed hen ¬ he tqgeis
activated and 9ls condft fon ?S tnie
could ace?vale a
An Insentidelele, update statement
answes Sel is
Quey 1s ntepreted as tme 4f the
and false fl the que has no answers
nony
acton
JH the condf{loo Pat evaluates - l o t e , the
2
associated fth -the tHgaer Ps Executed
’A Qctlo o can exanine the a S e S {o-the
Hhe condition pant of thet g e
oqgex
’Anfpontant 1s5ue s when the actlon Pat of a
eyect e ?n a nelaton t the 6tatemen that activnted
|Pognanming
Web HTML
web PHP
web
Asp
Second Nma/ Form (aF): OF elCnbates edurdant data
Attîbute be dependent on -the
nequinihqthat each mon
-key
’This men6 that each solum should be velated to the
key and mot to btoen Colums decty
EX: student Group
RveNam Goep Fee R-no Knoo
Ram lok DBMs
2
Shyam cce I5K 2.
3
Raju ECE l2k 3 DBMS
RNO wame Lag- knon
-P
tw Group fee
Ram lok
Ram p BMS CSE oK
2
Shyam ece IsK
shda Java
3
eaju DBMS ECe I2K
Thod nonal -forn (3F): Foy a elatioo io 30F, it muse be in 9NFand
(o)no mon primne attibute is t ansitfvely dependent on pmme ke
attibute cb) fo any mon tifal functional dependency, key
ethe x is a supen ke o1 A is a Prne Attibute XA,thes
eX; Student Fee
Croup
noame Giroup Croup fee R
Ram CSC
KnOn
lok Lang
DBMS
3 shyarg ECe ece
Sava
DBMS
BcNF: BcNF i5 the advanced vension of 30F
Sectlon subfect FacuilqTime section Faculty Time
A Cornp Sudhakas 8:00 A Sudhaka 8:00
A
B
phy 9:0D A
Raju 9:00
comp am to:00 B R am I0DO
R=FAB,c? RyCAre)
Multf-ualuec Depende ncy MvD): muli-valued depende ncy
Ctates that tuo todepeñdent data vantables eand en a
table can be dependert bo thrd vartable Anespectvey
MVD bcctuns ohen too atEbutes io a tabie anende pen dent O4
eachother but ae dependent on tHd ynfable
>stoce, mD consists of a nmum V a ab ies to be
dependent on -thid vatabe. sojthe rinimu amount of vaniableg
neqied is 2)
Repesentatior f muD is B,C A
Mup a b a fs mult alued de penden t on B
not
mVD ex+st -these follofo g condftions0
Say Relaton
H any Attibute Hutfpledependeey onBie
R.foy all Pairs of datavalues in
DRi D R a
ndthe
Such that the elation R,Ca)+ Ra (a)exists,
o Rg O RA exfsts a table such that
elation blus
RCa) Rca) R3a)= R4 (a)
can that nultfv alue d
A (b)- R3 (6); Ralb= R4 Cb) then Ae
exist ohich means, Po he Dhs RR2, R3 E R
dependeney
ex: Dame COUSe
Hobby
Rabul
Rahul Pyehon |painttng
music
Rahul music
Rahu)
Veriffcatfon:
Pqthon
patnibg
Condtion 4 MVO RCa) = Ry Ca)- Rg(a) R4 (a) = Rahl
Condition muD R(b) = Rglb)- c++ and Ralb) R4 Cb)e Pyhon
Cordfelon3 mVD
Rilc)- RyCc) and Ral) e Rzlc)emusic
Dame - ’ - cour Se and
palntn
ame
--Hobb