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
You are on page 1/ 9
DOL DHL DCL Teh BEL
+-B Cacate [notat Gaard Ls Commi Select
t Daop date Revobe Le RollbOck
Alter Ly elere fo Save u
point
I» Tauncate
nm Bs b pate Detinition Language
& w wed tor Creating and rood fyin the
database objects duch Ga ables, nia) View -
+ Dot Commands ase sk to define the Steuctuye
ana — Schema, Clatabade-
+ AM the: Corman 4 DOL Qse Alito - Committed
2 i+ pedmane may. save oe, ml
ie Chatahage >\C €? fo Cacate new fable ox Catabase - When
— a able io Cacated itd Column Qse name,
7 ae and Sizey Qaxe Supplied os €aCh Glurm,
each able muda? ‘have atleadt one Column:
=CREATE Statement can be tweed fos
> Cacating Q database
> Caearing a table
> Cocazing @ able
Qt specifica Column names the fable, it
data type Cea Yaachas ind eyee Clade etc) and can Glo
Specity inseqaity Conaraairds Cog Poimeay hey; foreign
hey cuniqe)
sya CREATE TABLE 4able-name
Cc
Column named —datatyper
column- Name 2 di ?
column —namen datatype-
: Cinteg ity Gonaraairda)
)
i—Addxtes VascharClos), > Leryn 3 not eed]
* Salary numesic (lo)
7}
Emp-ID | Name | Age Add veas | Salary
|
“Hore? DESC oF DESRIBE Sia temen: ———————____
To dleacaibe the cletails a the fable Stauctuae-
4+ Gundar:- DESC 4able -Name;
+ Examples DESC Emi [| Cacote Qatebaee Aaleb—name:
+ SHOW Stecement
To see ex iating adahasts and able -
- BHOW clatahase j
- SHOW fabled;
“OSE Startemend-
T we 0d edie! any eridting database:
Ab Syrdat USE database —name;
el my- dbs,ALTER TABLE 4able-rame ind gee
ADP colurn— name clatatyb &% mut bible hale
avo Coltynes
sh
fe cxamyple’ ALTER TABLE Emp
= ADD Ernil yaschax (loo);
Jempzid | home | Age | addsea ae ermal
—-> Add em a
Coluron ernait
QVALTER TABLE - ORC COLUMN
40s semorving exioting Columns in @ 4able
Qyintar® ALTER JABLE fable —rame
DRoP Column —name Cs);
fy Example” ALTER TABLE Emp
ee DRo? Email; ‘TABLE ig name
HoDley Qlurnn— name datatype j
- ALTER TABLE Emp
HODIPY Mame vaschas (loo);
“ F en
6i2e ig [20] Chech it With
Change into desc coramand
Tloo} fe Moctigy
uw) ALTER TABLE — RENAME COLUHY
fe sename an eridting Glumn fn @ able
| 4 Quntar: > ALTER TABLE 4able —name
RENAHE olol —Column -rame Te new Column 5
Example ALTER TABLE Ernp-
a MovlPY Addaew To Location;
| fase] Name “a Location al
, cae
i, [ onby Glumn Name
pase: aeneme tn foasion“To cedete the
) TRUNCATE *)
ri
+S PRO TABLE fable — name;
dt €ample DROP TABLE Emp;
1 used to
dable- it id
we a
toyed
fable ct
“Paces fable
ith
ae
complepe database
# Syrdet PRP DATABASE database - Names
semove 202 sows 480m G
oimilas to the DELETE
Statement with no WHERE Clause:
Fonty delele the value Mat Jable Stud]
Gas eOr TRUNCATE TABLE dable-name;
i xaample TRUNCATE TABLE Emp
,
,
'
' .DRoP Command & abo be tutd 28 Database:
emp"
Emp-id| Name! Age Location
4 4 3Q Dethi
io OF Pune
4 “Tauncete commana
Empio | Name | Age Tocadion fb Shucost poeocnd
~~ pee
|_| _____} .
dettey
) meand & cont Pesmanendly agave ate the changes
ia a ao Cebspeed by Cdetespio
ke ie Walon All ai ras reaeavedd +
j " INSERT U he INSERT INTO Hatemert ja toed
| fo ined new secosds in a fable
# ayntar | Specty both the column yalués and
the values to be indeated -
,
‘ INSERT WTO 4able-name ( column!, 913 Nn)
’ VALVES ( value}, Value a, - - - value MW)
eee Speaqy only values fo be inserted:
Bue needed to semembex the column
osdes
INSERT INTO able —hamc
values Cyalue 1, value Q. - ~~ Values Ni
pe to HoddiGaon % databaze -
Example: émp
Emp-10 | Name Age | Adldxess Salaeg)
Ran | 39 Dethi 000 O
Kagoh | 2S Quine 29998
45000: |e BSR Vc gs ‘ Gq sen?
WTO emp valves Cu, 'Chisag QS “umbar' 6)
erect ® oie ’
pect enh ‘3 fo see ratse’)
DATES
oR ‘ Ue modidy the exidting gecosd in Q
; fable |
tue the RE Clawe wrin the
‘UPDATE §«Giatemertt to tepdlate the selected
dowd, otheowie a the wud would be affected:
PY oppare Jable-name
SET Columnd4 = value t, Column d= value 9 -- --
wheRE Condition;
| # enpie To -Updase the addseas 4 Emp- 1D:
3 +o Chenray’
UPDATE émb Cobspafeed by Codetepio
GET addseas = ‘Chennai? Sh ayglts reccaved
| WhERE émp-ID =35
im = =Hove on €mp fable:
kasan 93 | Chenai | gooo
ee ORWooo Lulu lll blll dddddddsd ddl
#& Gampl” +6 actee the employee seconds 4
Gune Location :
pereTe FROM emp
(wHERE Adolaeod = une!
To_ Check Coysiaeed by Codetenp-fo
ELECT * All afgfts vexcoved
Emp
Aas Te | age | Aaldeeas sala
| Ranud | 39 | Oethi Roa
: a oo fete 30060
‘ co [ z oe 4ySo0o
([CROD] > Creater Reads Update, Deter )
3) ne ‘4b Data Contsol Language
- PCL Command ase ted fos Cortt sobbing the
aoes acta fn Q database
we io wed to Corttaal paivifege in
Darahaoes: Fe at provide sight 2