0 ratings0% found this document useful (0 votes) 17 views13 pagesDbms File
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content,
claim it here.
Available Formats
Download as PDF or read online on Scribd
/ ayMent - 6 ot
So heplain DDL mies
as opis Date D,
* DOL commande ar a 4 1
datataae, objects, Much climes
views -
+ St ised po voate or alter othe database wtpucture -
DDL Corvumiande-
> Guate - Crates a mow £ database object Like artabt
Liew , indlexr 0A databace: Ubeename—Stuclons
2 REATE TABLE dtctents ( Cotiemn no -4.
Atudert lp Ln PRiImAry KEY,
Name — varrerar (0),
INT,
) Corte vagerme (50)
3
D- peru - Moctefles atruretur of an exiting database -
Zier vidd , delete or mocreyy
h ALTER TABLE wWtaclerts
ADD Emathe VARCHARCIOD);
3)-DRoeP - aeleées .a2 elatabas table. and all dala pew
fr PROP TROLE Steectents ;
4) -_TRINCATE— Rerroves ale Aaelede olate om they
wtehout aclkete’ng tatty uttely.
4 TRUNCATE TABLE“ dtadents 5
5)_RENAM E- chamiges mame of table fo another.
SEO RENAME ThE deudensts te loaaners ;Ques 2) explain DMe avith crample
Ps- Data Manipulabore (muy
+ DML commands LUe & L do ymariputte Gata wit
entativg database, pepeduAla i
ateouy wars to add, Ayrdora ,dolete and Hotrieve
« The
das atored cw tables
en
4) Sevect Command - fetsueves clata rer one or mae
tables -
_ cevetre FROM Students ; J seotsucours AL vepws and
Cotums ate’
2D UsERt- Aclola new kicords nto a table -
aad ow cingle noord ~ &9-
Inseet into Sta (Student © , Name, Age Course)
VALVES (1, ‘Saumyat , 20, 'CS€’) 3
3) UP Date- moolcfres mua data ‘uv tavte -
eq- — beprre Utudentt
VET > 2)
Where Wtredentio = 15
4) PELETE- Removrs 4Ltcoid rome fate :
eg perete from Lrudents
where Stldenrt2 23;
& pMe pees -
2 of PPL
page i Dotabae term.
co
Dme
pa
earce cr] [See |
ree feat | ree | st | | Prey | seeHiagmenenct Dba
Asm2- to iuplmunt pate, Constrarrti -
72 Betmaay He — at dlepenest, “at column fever -
Aybar’ CREME TPBLE vtablename (Column narne |
DATATYPE vorstaarmt «< coment
name 1? Buiw (Coltumnname 2
. DaTATyPE » CoUrmn oo Datatype--- 05
o a bs olefirrerts vat -tatrte Level
Cte oreate table tavtename ( Columnname 1, Dar Arys,
berm named Parnryre, Cotumn name 3 par AryPe »
Pai MARY KEY (Columnname ) , Coleemnname2) Jj
b) Check Consranein—
+ abe he fined vat cotiumnr Level
- (Rep te Treb tablename ( colunmname |, 2,
OLULMn Mane 2 Date ; COlunmnane 3 Data ’ pe
Cheek ( legal expt ds Check. Clogteae exp2d)%
+ dreds olbeo cLefined, vat table tuyel +avn % D << , Colname 3
exp 1) > CHECK ( Lofitae exp 2))5
C) Unigue Lowtaarice >
"AC Column ened -
- CREME ‘freir tablename ( Colname | Dat ON Ov,
Co * Boctatype Cotrame 3 Patatepc UNLQU' ves
“AE tanle Louel-
Siprdtan- Rete TABLE tablename (Coenanc t Datatype ,
Colname 2 patatype , Copmmmed Pasetey pe, Ua Que
Cuootname 1))5
a) NOT NUW Contaamnt -
ee Oa
- CRepre Trbre teblename Ciptrname | Ditotyn, |
wot Nuuw , Coerame 2 Oaratipe Not NULL, Coename 3
a)
Dateyp
> Gy ae :
FATE TaRle Gredeut (peelint PRuvaRY key,
pram Aaichar (20) unique, pow ord not int
cack snr CHE (p-Stock >= 5) » pexpirg »
not NULL >
bar o Bie (uotename (Colname | pas a
: es CREATE THGLE "Citing‘ Expuiment - 03
sens To trek. en, Data Mamiputad
- tommmamsds wir Roane on. wnquegs Come)
ot wee fo Unelerstand Dara ; :
a Command - Moniprlelion eae
Tne DML wemmands Ou Most frequnity voed £OL
Commande and is wre fo 4 and
Mmomoulate dhe exch ilatcebace Wbpeet
Some of commande “h te
) Snap
2) Sede ck
aj Upelae
4) Deleke-
— Procedure
@) Qnusr Command - at is uae Je adel Sne or yore *
bw fable - OS
o The values ett eupoenated a el wove da benipr
char and data ae enclo'! win apertre :
athe values mat be antercd uin same oder ae
th aw deprived -
. rin intl vib inte @& table -
Zhabte raame > VALLES (exp, ape
Ayrton - Tricert tuto
> rae Later 4
ong > grweRt INTO Puoduet vewes (101, Cherolate’,
25 , 0-202);
7 serect #¥ fem Product:
socorole cuserlg a vung
’ nang mow Khan one
inst Yeonman -
fury = vins€1 anh product VALVES (102, Cookies’, 10,
a tor 20rs) , (10%) ‘pumnonds’, 20, (2- 2024) ;ble Lect Command- 9g 44 aed & Ketter “nto
ate tabee ge os qrtiably napa ue Ae sey
* Wecanecthy dis pl ag al vlumnr Wa table ery
Apert ect xf tatsle .
View ate wows ank ate column
L ~ Létecr & bio trblerame ;
"SECT » prem procluct ;
' Cyretove ~ SELECT Keats s ecotes pom teklenrame 5
Saag: Leder P-rame, peort 4rom Creroducts +
. ave ele ded veotirmn sin ou .
ani SELECT gcocry fiom datinanre where
hc Bay. +
Blemingted duplicate rows: :
fut p-name prem Protech whee p-lol=do;.
O) VPPATE Command- st ts ured fo aller the column
ERATE Command
TANS nol un a tate.
"A aw je = cok Mm to wepela Peo? OY more thar
One feolumn cout epaated .
. “patina att Voss.
4 ~ BPea7e dallename 367 comanne column = . . 3
Mey eg U Pope & sprecluck 964
Perpiny : dors ;
* Update 4uerorol es%. 7 whe Uabtinarne cet Pets . evatune >
Kon> 5 §
> ene UPDME Puoclurt SET= 10 whe p-fh = 2015
A) DELETE command-_ Atte he Low iw & table
we Caw wlan
© The delete nota nie 4 7 om’ cohauet
portend ephonat tubere’ Yclotise
Removal wll hows:
he DELETE from ctabtrnaner ?
Be ee Dem“eTEe fem Qupduct 5
*=Remowal Li Lt pict fue dcOw *
Satan - DELetes few < tabklerame> — ushere ,
mde peut e Oe Porwooluck whore pa ® 201,
_ DML commande wie Cxrecmbed aucerasfully -o he ours oly eer is hace U
ft MO per mises 7
on fev Aucl,
. . rn . S
hi Uw Lalle A Gog df potvelapca..
Geeann ouiveleger Af Utena GRANT statement .
the danse fafement Vv inoutole varcets type of .
| PLE Ne databay Ab jects vouch Qa calle , thee
BRANT fotteet pant leges }
On ~olteet Name
TO UWrenene 5
Cae pre weleges 5
Cort Bt-fect prvtige that £4 Aamtech, authorise,
khe arte bo pefeor™m some pUaHOn On flip
ctydle
eee aren au Pevelegea oney om AptetficThe (eet of eject prevdlegee us ee Lore »
J MTER- volloine fuarantce do change tate Aefertion
) DELETE allows the gearoutee bo peomnoure the sera
om rab with DELETE Kammamds -
3) twoer- Glows Anlee Yo Create an unden ‘on,
table wove! crenve Puvex lomnand .
A) ERT allows Ute qarmunice we acl secords by
torte with & commend .
6) SELECT- allows the qriocantee do queries the fable
with ceeect Seommand .
6) UpDATE- allows guarantee be mo ivy the Accords
de table wrt” dhe uPpaTe Command .
R n x Suen
stant bomee, Ueda co
caw bt .eniech 4 a ee cacy
REVOLE comm 7
Overt weusmnenr tom vovoke i
pn Za (Asautee 49
aeotter teen « Age GF
© Revrokeng pemitaon use REvoeKe STATEMENT .
+ The REVOEE otttement is atotol & oleny ee
te buy vabfect +
ipen VORE Leofect pee seats J
On ot-fect mame
From Uuername 5
athe REVOKE command ui ued fo REVOKE 4
ce ae
puvetgr dhok thre dew
opuaiantte. de ke scovroke
* The vieweke command cannot Le used ue ero ke
Hue fates cae “hxorcaly Bpuaing Auster
Reet feria dd DCL statements| $n . _-
Experi MENT - OF
Aim:- \
oe Suerice fo omplement TeL commande
Peet ty undectanol TEL tommaols-
Theo -
Transaction Contnot (TCL) commands ve
utc ip manage trarschon dv ce dlatabact: | |
These commandls “emuine date Comacatonig © Dinebns |
; t |
fy Contnotling, the vchangee made by of
f Major TCL commands - |
D lommit- Saves atl charge. umady trv the event pansacon |
tty
PeaAmanen
Suntan t Beyin TRaNsheri0%) 2 BEGIN TRANSACTION — |
INSERT 2NO tablrname (colt,cole) INSERT Exo LTO
VALVE (vali, veer) ou (mame y |
UPDATE tabte-name SET Cotrs wats’ ‘Vacves (taurce', uP), b
WHERE coll: alg’; UPbATE Employ SET |
commrt +, dipantment = \Aevante’ |
WHERE names 'BOB’, |
Commet
2) Rolttack- Undees att whanges made vin the eureent
transaction
Sumtax - BEWIN TRANSACTION r BEGIN TRANSACTION
d DELETE FRom ctabte-name DELETE From em,
WHERE colle “valr”, WHERE
Cepasemend » 113
ROLLBACK ROLLBACK
3) SAVE Pom1- Sets a poink within a transackon So
~~ wehetebe 2 ean be yeatled Lact.
- BEGIN TRansicton
“BEGIN TRANSACTION
Insert into table -rame (col ,cot2)
INSERT Jryto emplou(name,
vay (voll, vate) Were eepe
© .y
Spveroint Pts Vi CChastie’, ‘mate ps
SARPOINT Ep, "4')
7A) Ree TRersaction - Sets
wy Atay
SET TRawsaction READ only
S€tret FROM table name
&- SET TRANSACTION READ ONLY
q
SELECT & From employ
Ypropertien ‘few uw framsacbomLEXPERIMENT - 06
Atm -
™- To trplement normal forme sin Dame
Ob onge
[eetive- To dunductanl Norma forms
Theory -
de as the process of etme ong seedundancy, aaa
felatons vor ae of sulabons’
Normat forms vere Lised vip eliminatt vor sceclecct
WUduindany Uw database talrtes-
N
*) fist Normabdoum -lINe)-
This ws the moet basi Level of normetisaton
Sr INP, cach tant col ahold wonrtacr ony eo
nengle value amd each cotumn shoutd howd ae Unique
mame +
&) dteond Normal tom (ANE)-
‘A valation cs ae ape uy ot te @4Ne and oes
Ton-pume atintoute is’ not yposeintly CLoperrdtert-
eae prope, Meth of omy andi date sa of
trbte-
9) Uhtsd Normal form (ane)-
A helation, ul aad we dw this noryal orm
an wwe Aid mot have any tramechve vale indeney
nen- piime ettubute Y Basic condition’ that!
muat be Ahold un the mnon-tarwiae fenebonal
epenstenery xov.
Xe aupu key
Y & prime- attacbutes (tis oncams that coment of
Yas come past of Kandé date wy)4) Ber (Boy cee Cocte, Normal jJorm)
a ana fhe odwvene ev veidon of Normal foun
home” bate surly ate -
1) Table Must be Uw ZNF-
Y Gn relahorn Y¥ OY, X Mut be ca auperkey
dwn sulation -