0% found this document useful (0 votes)
6 views9 pages

Adobe Scan 02 Oct 2024

The document discusses various aspects of database management, including triggers, subqueries, and control languages. It explains how triggers operate within databases, the use of subqueries to filter data, and the importance of control languages in managing database operations. Additionally, it touches on cursor types and their functionality in executing queries and managing data retrieval.

Uploaded by

yeolepriyansha
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)
6 views9 pages

Adobe Scan 02 Oct 2024

The document discusses various aspects of database management, including triggers, subqueries, and control languages. It explains how triggers operate within databases, the use of subqueries to filter data, and the importance of control languages in managing database operations. Additionally, it touches on cursor types and their functionality in executing queries and managing data retrieval.

Uploaded by

yeolepriyansha
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/ 9

ti DATTA~fEGHECOLLEGE OFENGINEERING Page No; _ _

Date

- OBM.5 _ _ __
As SLg_nro e.o .L NO :- !2

_ _ __ cile. s'cor-t: _not.e_on Tci99e.'Cs '--'-.._ _- __


11

~ •f-1 Trig.g t t _J_s- Q_ ~u~ _thel.L ts_a uto~ ti c.o.l~


~ by ib.e D8t"t'\S to_resp:1as.e_ ~ L£ic..
- - o..t~OV" tn tbe dQtQbQse_ __D-r:' o___tob1e _
- _ in_dQ\abo_s e __
. • '""I'r'igg e-rs_ a-re.. sto-red j n c\a.ta base -a.s a. _ _
t_ simple chta.b:lse o~cls . _
• A. da±abase tha..t hos a se±. oF assodcd:ed
¼~g~ _ is ml led an _active daJalJQ.se... _
• A do.ta oose ~9g er enahles DJ3A... to cteo..k.
-°'d d tti onaJ -re\o.tt ons'n, p behJJ e. en s epo ro.te.
"lj do.kc bo-se .
S \/NT F>.- x :-
- _(R_\:PrTE [o.Q .RE~LF\CE] lR,G-CtER
< ,r,99 er _Nome.)
[ <. \;.NT-\8L\: \ 01S/\BLE. >] __
<: 8EF0R'EJ f\FrER '>
< I N§Eg1 \_UPQf\it:. \ _Dtlc'TE >
ON .::: -rg. ble. - nom V
_ __ _[FOR EACt\ RnW]
.- _ J)EQPi Rt= _
<
\LO"r'tO.'o\e - de.Fin_lnof)S _) ~
,_ _,_ _ .OOG-1 N - -
_ < 'Trigg.er__ cocLe_.>; ----
_ ENO~ __ _
- -
--1,2Tui9§e.-o --hJ pg_s ~' _____

----------
,e, DATTAMEGHECOLLEGEOFENGINEERING ::•• ~ ,

OJ Rou:> _J_e'£.. .€.Ltr-i 9gecs:- -1 . - ~


A T'Ou:L. teve I ~i.g-se o ~ 6 ce.cl_e a.~cb ._.__ _
time t.he..:ia ..b\e ts ~cl:e _d_ -'oy -1:iu.b. LJ.e__,__,_ _ __
TtS"\9 geri n ~ • ___-~---
SJ:o..te D:ll?fil::. ;
- - ~ - - - -- -
lb) S t o.tem e n c Le,1et -fl"\f 99ex§ :•
A st::o..te..men+- te.v e.l bri<::3ge.-r 1.s Eire.d -00\y once_
or'1 be.hoJ f a F tbe b°'L9<3erio9 s±o.1-e rnenl- , ~
,'NOOpec~i ve. a~ no. a_£. ~ ln ihe l ob\e
~- l'na..f o-re o.fr-ec .led by ~9 g e-.! 09 s~~ me 111: ci
• Tr199e_r ope'C'O..tions QY'E.. ·- ~ _
co.> Da_-t:o. o,c+io n9Y"j fo..Y' tr,gge rs :-=---Once.. higg~ - -
. o:re c~cu-e.d 1 he Lr de~i n i hons can be... \Lie w ed
by sele.c.Hn:1 it rr'Oro SLJStern +CL'o\e•
S1..jn t ax :- ~
M y S02.L > Sele.c.l:- ~ from

! User~ T'rlggev- Wti&f ...


l"r \'99e'<' -Nam e == '< Tr<gg er-~e > '_; _
__

lll b)D-ropp, 03 l"rig9eY's'.- 10 i-emov e rn~~ rm_m _


- • .
7
ctaia'o ase _ we use comm and PROP,
1 ~ n~·-- -
\ M y S<QL> Drop tl'i<:ig e~ < Tri99e r _Na.me .>; _ ~ - -

c_C) \)iso.b\i_ng 1 ri9ger.s:- \Q deo.d1vCL.k. mgge-r -=-- -


tm) pD.~l l'j -tn\s con be ac.avrue.d Ct..<3oin ~__ena_bliJ:S
SLin ta.x .-
M.½.S<S_L > A\te, msg e~ <=tncag e:r_ Name> - -~~ -
- __ { disab\ e. \ enab \4:,__ _ _ - ~ - --

J
I
~ DATTAMEGHECOLLEGE OF ENGINEERING Page No.: _ _

,...-.._. Date :

n - J
:.i _fxplo.io neste d query (sobque.r~) with suitc. tbie_ _
_exa.rnpie~_._ ~~ - ~- - - ___ _

~ A._su bq_ueY\.\ "1 s o. ' f 9..\J e. ""Y wJl'n, n o. 9,uP-r ~


1)
USu oqu e.~ rs qu~r~ o..ppeor witbi n --'ctHERc_
_01' 'if\\J\ N~ c\aus e of o\'ne r queY''.j ·
_ 3) Out:e.-c q_ue ~ Ls coJ\e d cs rnrua. que.'.'fy _
o.n~ inne r 9_\Je..~ w'n\C.h is wn\: ren in
o 9.u,e ~ , 1s ccJ1ecl subque.r':1 ._
Y'()()..\ _
_ ~ Subq uer~ \-n tne Wr\'ERE cla.u se ·.-'T'ne. reson-
or
tn_e s009. ue.r" \ (inne .r) is _used to se.Jec.l:.
eom e '('QIJ.:) S \Ton, Mcu n que:nj ..
5) 5..>nq,uenJ in_th e t\AVll--\G- c\o.use ·- lhe tesu ll-
11 o~ Subq_ue'C"'"J Unner J- is osec t to se\e..c~ some
~"'°u ps From rnoJ n que ~ •
I &) Sub que..rtes can be ne:;t-ed w,th1n Orlt>e~
rub 9..ue-r\es.
l S'INT~~ ·.- se\e.c.c_ Hsr
SEL_ECT
~ROM table _
wti \:RE exp-r _opero.cor( SELS:.T se\ec t-Hst Fmt'l tab-le)
Exp ~-ap e~to r can be. two ½pe s :-
<..,) -6\og\e. mw cpeY1a.lo-r ( t.., >" t..~ >=., <:? J
I (.2) Mutl iple row opera.to¥ (IN ,lll--1'1, ALL) -

. EXAMPLE '- To fin_d ·lbe. narre of Emp\o ~ees wno


JX>ort.s in \So.le .P~ Depa't'~roe.o~ , we c.an u.se _oesl(dq_OO}

5~LEc.T Na'<Y'e
(:Q.DM Emp104ees - -
_Wr\EgE _0e.po.otmeQtl:O==--{SELECT 0~rtr nent- 1.I}_ --
_ -~ _Fmt:1 Deftl:rrme..Clk'S _ _ __
Wr\cRE _ ____
1
- Oetx1Ytm.eJl.c- N_a_m e..;::_ Sal.es')~>-- - - -
-~
~
==W=-§~D
=AT
=TA=M
=EG
=H=EC
=O=LL=EG=E=OF=E=
NG=INE=E=RlN=c~:~-:_"_,,,,;
(Q3] plai.o__D_CL QnQ
- -l"CL cosomoo d s :-
---'> Da:l:O
Cool:rol 1anglJOQ£.-_(ocL) arid ~ -
Coo®\ loo9~e._(T'C\.), ore fu.)o sobse}:s .QE_ ---
- - f f~ ~ commancl.a_ ~eq in OBMS · __ --7
lOJ:a=..Co.ntrol Lang_uo..ge_(DC_LJ > DCl- cornmuncis_
>
_ _ ~us..ff)_:lo -.J:O ntto.Lo..ccess ±n_d~ 1a _
da..-\Qmse_ . They he..\p Lo.. d.e.f\O.\ng_pe..nnissi an utrl
tlQh!:S__ .foLuse'o J ._~nso-rl.ng d_eu:q s e.ruri±y and~ ~
_Q c.o.mro.o._nd~ . _ _ __ L
- --tt-t-1 3G~_N 1 ·.- G\\J e..s specl.E._c p'6'n , \ \edg_e_s ±o_ _ _
~-+r _\JSe'lr o.r TO \es _ _
- - .. bX '.- G:R~NT SEL'E..C._1, '"I.NSF QJ ON Emp1o~css
.. LQ_ ue,_e"lr A ; _ _ _
~ R~o~ ·.~ 12~~Lf-ic _p:ri_-Jleqes- Tu-oro •u se~
+ Ex ~- Rt\10\CE' INS~R, ON E"mployee6 E&o t:1 Use.v-_A_:,,_

.2 T~ANSf\CllO ~ CONiRQL LF\NG-0 AC:rE. (TC.L) :- -CCL


.. command s ru:e used -to rnamge. tmoso.CHQO~
~ n dQtof.Ylse. TCL e2nsu're.S da.tQ_c.ons.ts1-enc_~ and _
_..._ -..-in
1
tegY-i t'-j . _ _ _.
. TCL cornma.ods > · ...,
.[ i JLOMMfT ~ Sa_ves o.ll changes. ron.de cllJri ng fue._ -
- _CT)1''Cenl:. tro os_a c..ti o a_, - - - -
- Eromple_:- COMM.I 1 j _ _ _ _
-
-.
-

[2.J RO LLBAtk ·.- Ur.does a.1, cmnges_roode d.urJ ug


- the._ C.IJ'rl'e!'\t. 1l'QOSa.C-\:ioO \_t an_e.-r.ro-c _OCCU'fS_QY' -
- __±ne. use..-r .D.bD'lf'\-£ iL --- -
- Example '.- ROLLBAa..;._ -
3~ SwE.PO I NJ : 6 eJs _o... p::ii.nt -1&\.tbio o hx:1nsa ct\o.()_
1P UlhlCb you can .1CLte:r ro..\L .t>ctcJ:_!,. __
E><etm pl e '.... .SAY EPQLN -:r_eo,~po1c t:._i _·
- -
. I
' '
.,
~-; A DATTAMEGHECOLLEGEOFENGINEERING ::;, : - -
,\ -¥...::i..,
, Ll
l.1.L,1-',-,\,,U..J f.U~ w i tb £. OJl.QblLexarnpµ..u;..\e_,_._ _ __

C..\)'1'£?-r 1o seen \s . a. da.tabase


o~ecJ: 1:i<ecl
- - -n-_......'-l:f t:c, e'>! e I
moo Lpu\o \-e.__ond o O'lll9 a..J.--e..- - - -
-l bm\J9 b..__0,,_ -caso 1t: .sec row ny_mw!-.!·- -
t'S O'C-9 are ,~til..uJorl4 usenl\ wneo yn_ u
---1,_n_e__ecL :b:). ~ c.ess Jo..ciilli_a.uoJ_row..s b_j __
- H-re.t)mec\ rzj _Q. 9_,\Jff\j • _ _ ,. _'_ __
. . ----
Tljpes_of_Cursors ~- __ _ _ _ _ -
1- LJJ :'.IM£LlC1 I WRfillL<S :- fuJ\nmoJ:icallj o:e.o.i:ed h.~ -
_ __aaxQ..bQs._e_wnen_o._s©-L quel'_y Ls exec..u1-e.cl • -
'L~u do~t _ba._\£:€ _o.._dl'fect c.octro) _ ave.~- _ _
_Jm plic i t-- C\J'C.S ro:-c; • _ _ _ _ _
- - - - - --- -
2) E1.P.l\CtJ _cu_&saRS:- _QeRoe.d .by -\:'be. user
1n p-acedl.J~\ _e_oct_e._ ~ ~ po0c.e_ ss the__rows
01= o.. qu_ery a-e_su It:.. ser o_ne o..t _a._ +i m e. _
.. c om·poneot.S dF-_ an E;xp\ic.Lt _cu_-rso-o;; '.::
--- - - - - - --1

QJ_ QSLLB R.E ~- D...eRne_ ±b_e. $:Ql$C)"r o:otl QSSOLL..cu::f. 'tr-_


:-i _ _wi \:tL a. SCQ L aELEC...T s-toJ:em e'Q\:...:.. __
- -
[1LOeaN...'.- inino.H2.e. ±he. ( ~ ( ) Y qncL pa.pvtet!:f it
_,._.,121_1«L.-1b e ~uLt- se-t: ·
- - - -- - -
_ _ [§.J r-eJc.ti ~ ~e}-(ie..ve eacr2 row kam the._~u Lt sci::
--
. _\.l"rl9 \10 Y'Lo.bJ-e.s. __ - - -• - f

- -
- --tt_._'-lLCLOSE ~- .Re.Lease- -\:he. wrsox:'5 ro eCD..Or:} ..O.nc\
- ~-V..\.C._..__ up.- lr€..S.Q\Jo'c:£~ - - - •__,........._ - - ---
1
II

:IIJ DATTA MEGHE COLLEGE OF ENGINEERING :., ., .~ <:::,~

SVNTAx!-
~-- L
Oecla.-1'.e
cu-csa~oama C.\J RS.OR . -
- - - n - Fo.R.. Sl:-L.EC.T .J:t FROM -f;C.Lb..La .-nome..r - ,/;,,

---n Exam.p.1e~ \tJe. b.o..~ employees-fble.. witb ~ ?

COJvrons... - emplD..jee._,'d ,,_oo.rt:> e ~tar~ · -- .


0.ECL&:Rc _ -'-____._~- - - --
empJo~e_e ...cursQ6"' TS
CIJ..RSQR
_ ____ SELFCI. emp\oyee.-_i'd , rome, soJa.x:'::} :1'
---tt-- _ Emm emp\~ees; _..____ -·--
- -
__ _ emp-id__ eropto~ees. emp\oy~-\d ·t• J'iPE;
emp-DoJne emp,oyces-~name / 1'1PE; 0

- -- - erap_sl\.lQ~ em?\O\jee. saJa~ ·;. T'/F: ~


____ B~N -
_ QPEN-. __em pl o'-/ ee_- c.orso Y; __ _ .:.. ·
_ __ LOO.P
_ _ ffJCrl e..mp\oye~- ~u-rsat 'INTO e_mp-i.cl/ emp-nam~
__ . _ernp- scilo-ry-J
f )l \ l W.HE.N eYY1p\a~e-t._uY'SOY .'/• N Oi .FOUND .

--
DBt,15 _ ov•tfYr :..P01 -.LiNE C' f:mplayee'TD ·, 1 11 -- -
~
- --
emp~ic\
€.mp---8QJOY::J
~)D LO_Qp ~ _
1\ 'Nam)•.' II emp-nome II so.iory:
., --
1

-
_
-
_
I
J
- -
_:_ _ -
=•:-
_ LLOS.L em play e~ __c.ur-scy-c ; _ _ ___ _
_ _ fND; ____ - _ .:_ _ L:..._. - -

01JJP_UJ :- -- _ -~~ -- - --
-
- --- - ----
-~,1----"'-' -"-•·Plo-y.e-.e TD : __ .Lr Nome ·.. ~ l'ir\ ~ So...\ax-~ ~ 3...SOQO
_ .,_._._.p10-4f'e. 1D ,_2 1-No.rne . S1mmn, Sat()_Y\l: E _QQo
- - 1 1 - - - - - - - - - - - - - - - - - - -- - - - - - -
➔ ''o

~ ,~ DATTA MEGHE COLLEGE OF ENGINEERING PageNo - -

' Oa~te ::::::i:=~ ~==-=


-~ l~ ~== === === === ==~
\ .5 List- avt- diff~re nl:- pitfhl ls j() RD BMS de.stgD-·-

PitfoJ) s \O rela.\\ onol CXUabase. Vesit3 n_ _


-o
~09ge sr -\he. E:tfe.c.ts LO'nen c\o:i.Q base de.~ 9"'4-'~
1s lJJroog cir 1nco-m.c~. --.-- - - - - ---,
Common pitf-0.Jls in RD81'-1S Des igo_:._-
c.o.) Red vndan t- dat-a :-
t<ed unc\ o:nc~ ,s mot- o~ mqn~ prob\e ros
)n OSMS
- RedvndQn\- _dQ1o.. ca.uses fo\lO L).)i ng p:robte "hs .
• \nse~\ -, de.lete o-r upda..t e anomo Jtes
• wo.soge or Stora ge
· Gene'r'ru,·oo or \nva.J icl cla.tQ •
t'OJ 1"nab\\ i ~ to Tepresen t:- .some cLa.tc.t :_- ·_
I- T\: \S -t'n e eituo.. i-\on wne...e. -the des.L<J n ---,
o F- +h e dc;::d·a oose s\-!'ug 9 les to a cc um.t-e l 'j
o,r eFf-\'denr\y mode\ (e'<"\c:Jn b:)pes 0£-
do...to . o-:c relcu-f one'ni p . __ ~
l
• tc) Oepeodenc~ oF variou s a.t-.-h'i 'outes o Lreloh·oo !-
Dependenc ~ ef \lOn 00£ o-r sema n cs c.s of
()..ttfl, b 1J tee spe.-c.i {: Ies ho w to toJ: e"(' p e_t_
..o..xt-f\, 'c ure.s vcuues in o.. t0p \ e o £- the
re1etnon o.-re_ tt)oJed -W\th each o:tne-r• ~-
J Loss oF infhrma-Hon ·.- •
Rel.OJ.\ on oJ do.ia base desig n ~3-bles us... I
E\Jm~Q o\j t'1fu'6'ma..tl.ao 'in .To.~ a E...to..~ (.f§' -
~\a.¼\ 0 fl S .W n,.c.h C Ct.use.._ IO~ Qr some. I ructincu:lab,
- ...lF iC\tm'mQnao \S _usew, t_be.Yl i-Lw i.\J_oe CL ~ 1

L s .eve..-re \':>"<'Ob\em fu.(' uncle...¥'.S.\onQ U1~-· - · -

L _ L
=
DAI1A~IEGHECOLLEGE OF ENGINEERING Pa11 ti , \.

II === L~ !:::: :=== === === === = Datu


I= -==::a::;: ' ~
-
E-6.plc..ltL nQLmoJ, sa.n on_ a () u,.\ \ '\e~ 1L~ OIJ \- .\
~
~p5 . - --
tu.. No-c.m.QJ..i.sa..ti 01') \.£ a. p'<'Ccess ~
O~Q' OLG~ do..+o.__ \C\ -\'ne c\a.to 'Ccls_e. • __

(2) :r.1 is._~ s~sl:erffinc_ o...ppmQch or- d..ecoropo~i r'\cj


lnb\c...-G ~ e\\ro, oak_ cto..-ta ~c~c\ unda. nc~
- -
) t::-lo-cmo...t\.so..tion \$ o mu\c- i -s):ep _
pY.'Dcess, -±n.o..t- p.J\:~ ~'n e do.ia.. 1n to •
a.__._ :l'Clbu \o~ form 'cy ~~o-v r ng th_e.
d u.pll'ca..t.e.. D'"'O'(Y) ~ e -r-e..\CL-\-\ on .
~> '"I; ,s_ a. st-e.p ~ s'rep deco mpos,tio ri
of. c.omp 1 ex ~c.o-r c\-3 \nto sL.m p\e_
~ C.D'lrcis · _ _ _

l~) '.J.~- ,s C1..lso c-oJ \ed o.e E001 CanoJ )\'·coJ


Syn c:hes<s. _
[
_ G)1\- e\imil ')Q.!e s -\ne uncle'b\'<'o...o\e -
cho..--a.l-0",s--H~s \\ ke 1:.n.se-rnon , upj.cu ie>o 0
t oncl de.\e.t \O n Q.nom oJi es.
(,) type s cf Nor maJisa.-Hon :-
a) F\'f'S\- No~m oJ fa'l"m
____ ....__ _-
_ _ -
~ -7-
b) Secon d ~crrn•bJ fcyrrn _
_0 Toi Y"d 1'\Do.rno.\ \~-om - -
_g) GC.\'\f {6CY'ICE 1- C:.ODO NO~lY\fil. f<1iM a:ci f:3 "\~) -
l-----t 1-e) rru)"''b _ l'\C)'fft)oJ FCt'N) _ - -- -
- - 11 J) f=jf-tn ~_\'°40"'mol £0:o:n ~ ____ ___ - - .
- - -- -----------~ - ~ - ------,
~-~'~
~ ,e
DATTA MEGIIECOLLE~E OF ENGINEERING :::J~~o·===========-====== .1!
11

~ Write .snort rio\.e. on Coric.urren c.~ c.ontY'o\ , -


<J) FundQ m eo \-cu · F"° p e..r~ er ~nSo.dioo
,s tso \oJ,:~ on ,
(?-) Concurr-enc.~ Conh-o, e n sures t'o.CJJ:- d.Clloba.se
tis-an sa.c.~ , o ns c.'fl!. ex ec.0re.cl c.on <:..\J'('~O .ic'-::'j .
w,c\"1(:)\lt dcuo. ln cons\stenc3 es 01r v\o1o..no.n
I' Of \.\S in \;.€.S-c\ ~ · ...-. - --

• If~) 'Jsolo..tion prc,pe"'t:i ens\Jres tn~ e.oc.h


t-6'CU')Scle:H <.:> n O¥Js + tt m c:,J n \)n wo._~ oJ: c tb e2r
. c.onc~:rrre.n t-t 'j execvt, n g 'hru ~s~c.t-\o'Os -

l lJ.t) 'T.h ea-e mus+ b_e >nte"(loctio n


VO "r'\ O\JS
1m ?lem en\-
C.QO.C..\J'fY~_J) ½-
~nLoY'ttn t
amo 09
'T"'QOSQC.-n () o) to
91s\-e'(Y) ,

~J _A\) +ne.. fo\lcw\og _e::_hemc.t.s C\~. 'c>o..se.~


en Self'ioJ,za 'c\,i~ av- Bc.bec\ \)_\es .
,~ ----
I- (_6)- to nc.u ~ o c. tro nsQc 'rlo o s
I
c:_q n
v \ o \01:..e
1so\Q.tio.n V'-litn p.ope....Y- _c_a.nnro L, ___ _
- - -
i8J W.r\.1.e. Q -S ho-c.t_S\ole OJ1- ~e.c.o\L~ _s_ysl:fm.
~ ') -Gctlo base. ttco0e.~l\ ts t'oe p~n__te.ss_Of- -
- ~-r{n~- -tbe.. .clo..tct:I:u.sL to o tlo_{ o _o.L _ - -
- _(cot~Lr_)_13tru-e _a.s _\ 1t-_ was_ be.face_ ·oo_ta.bo.se.
- -u--~,.\_Jl)'Ce___ accuss. ------ - - - - - - ~ ~ ~ -- - - - -

You might also like