Professional Documents
Culture Documents
DBMS Newwwww
DBMS Newwwww
an Xombli
ul(1 vit
tusth
(what
ate vitws 2 Explain
in Sal.
A vituw al 0 hos n wa
a u Kind
Viytual tabl.
Viewg Sel databare
the
in a veal table in
and COl umn a thty ame
wm mu mo
vtw by Selectinq fudi
c can oeate a
databae.
tablu bunt in thi
thu t a b l e oY
EPthv have all th mw
the tablt oY
Can
A v i tw
certafn Conditon.
basrcl on
Spethe we woA
and
Sample Tabl
StudentDetailg
Name ADDRESS|
8-TD
Har | kolKata
AhghDuTgopus
PTatik Delh
phanraf BPha
Syntax
CREATE VIEW vieuwname AS
SELECT Columni, column 0...
FROM table name
lama
WHERE cwncdithion vitw-nmi -> Vw for he vitw
EXample
Cveattn9 view fTom a Sihgle table :
Abhsgh DurgapUA
pratik Delh
Dhanra B?h a
DELETINh VTEws
view.
vYew. we can
delete (GD
to delete
an Exikting
Sal allows uu
Stattmert,
DROP
a v?ew uing ttu
olop
SyntaxDROP VIEW vitw-nami
dtlete.
uwt want to
thl vfew whfth
View.name s Na me
MankAv?ew, we can do u's ai:
delete thu vêew
wLwant to
DROP V1EW maHKivituw
UPDATTN VTEws
ol to
to be Sat
Satis re ol
6fre
o n d i t t o n nudec
an ceYtatn
h PA not
met, u
conckhons
u thu
pd Cte a vrew, 4 any
the vrw.
we wull not be allowecl to updoute vitw Shouwd
Should.
cveate e vPe
the
t w
whith Ps ustd to
Stattment
).The SELECT
Clauuse,
ORDER By
not mclucle éroup By clauwe
havetu DTS TNCT Ku4wovol.
Statement ghould not
n SELECT
NOLl valuu,
all NoT
3 The VYew Shodd havt
uling nutid 9uLY'u
The Vituo Should not be cveoated
4
Complex quen'u.
bi C7eated om a gingle ta ble. 4 tu Vrewc
s)The Vrtw Shold
tablu then we uull not be allowed
Created uung mulhple
to update the Uit w,
EX wl can use CREATE 6REPLACE vIE 9tattment to
add 07 Temove flds fom a vitw,
Sytax: CREATE OR REPL ACE vrEw v?ew-na mu A3
SELEC T Columni, column 9,, . .
FROM tabll - name
OH ERE Conduthon
CREATE OR REPLACE VIEO
MaTkAvr'ew A8
8ELECT Stud e ntDetait &.NAME, StudentDetail&,
ADDRESR
StudentMayke.MARK&, Stud en HMaKs .A GE
FROM Stud entdetals, Stud ent Mauk
WHERE Student Detcul . NAME : StudtntM Ks NAME.
Oudput
NAME ADDRESSMARKS AE
Hangkolkata 90 19
rattk Delhi
Dhanro Bha 9s
Ram Rajagthan 3
databcLtC occut
a Dw Ps?nseytecA 9
can be
(nvoko nu
Examble A trggey Cevtar
table Columnu agl
when
table oY
Shecfed
nto a
bung updated.
Ctablu- name
Catabn
achion aftr
te tnqgenng
Tun the trgge
After tggers
Statement i& un,
Create trgey
Stud-manksbifore
INSERT
on
Sudent
fun Each o w
ntid to
So,
oheneve you
Stored psuve
the
you can furt catl þrwcedunu
Stued
be p a e d
tovogh
vouuet t a n
CREATE PROCEDURE
me igt-prite
FROM
procluction.prod.
UCtgORDER BY
productna
me'eNDS