Download as pdf or txt
Download as pdf or txt
You are on page 1of 9

S0L Csuctured 0uem Language)

SaL SoLisonon proedural languoge


tuhich was inhnducod by the T6m in 1370S
LHhich is Used Ho CammuniCote. toith databose

Cacate
use Thsemt+

OpDa
Delete
Selec
-S@Lis also Colled os
Sequeal o& CLI lorguo
CCommon
Languoge ntesfoc This 15 only
the
language LOhich Con Use to Communioe
withony RDGms paDduct.
Oaacle

S0LServer RDBM5
Prdluc

Users y 5aL

SOL is not Case SemsiHve languoge tha e


on cmte S@L Prcdeined quemes o v
Spmtooces
in anyCase chonac.teSLethe DPpe 0

Jo Lwe)
Evey SmL Statem em Should
emds oith
colon but tis
ophional in.SaL Sesver

SubLamguages of SceL
Data Deinaionlanguoge CDDL)
p

Cocate
Altes
Sp-Remome
nmCote
Drapp
Dota mamupulahon longuage CDmL
Inser
upDoe
Delete

Dota uemy LomguogeCD2D


Select
Bmsachom Contnl amguoge (TCL
Commit
RolLBack
Sovepoint

Data ontol languaga


Garsont
keloke
0 DDLCData Defn.atio Lamguoge
This Lomguoge Commands c e vsin9 to defne,

modify 4 Dop om objeck 0t dotobase fom


5@L Sesved

Cacale -Cacahing o nedatabaSe o z e m


table im SaL Serve
Shep 1 Cocote onetd daBabase in saL Seve
Symto Cacate dotobase DBNAMEDs
c CtatedotabaSe MYDBS

Step2- Select The aequircd dotabase fom


SaL SeNes
Symtaa U6e <DB Name
USe YDB

Step 3 CarcaBe new table in


databose
5yntor g- (zeoe toble Toble.Nama
CKColumn Noma LOTD Lsi201, Column Noma
LOT> Isiza.] Joo6 olumns
Er -(otote Toble
ShudentCsid
Smame Chon C10)3 5fec aot
AGIE Tinyint)3 Decimal (f2 ) 1

Step4 -To Niew the Smuchre of fa.ble


Symtac 5p-HELp Lo ble. Hanma
Ex Sp-HELp Shidemt
HELP is pracclened 5t0oe.d p5edu Po@dune
ALTER To change
oE moditythe Stnuchure
a table 00a database
bsing the Altes Command we Cn persfotm
follotoing Duoperahions cm eistiatoble.
Topemfitm the.se opemaioms we DEqured
Subcommamds of oltea
i> Alte - Alte Column

i) AHe Add
ii) Sp-Renamee
iv) ALTER-DroDP
in Altes-AlHe Column
- To chomgedototypef
also 5izaof the datatype of a peicula Column
Symtac. -
Altes toble 4TND AlHe Column Column Name
NeDT> [New siza1:

iAller toble Ghidemt AHe Column SNamD


Nomcho C50

2ALter- Add - Adding onec Column to add


Saistng table olumn
ytacs- ALtedoble 2TN ADp Ne
Mama LDI>ISi221
ALles Table Shdemt ADD SAddae ss
Vonchoe Cao)
- To chonge
a
olumn no.
1i) Sp-Remome
in database.
03 toble n a m e . Columname in.table:
A)Syntaa.o chonge a
.coLD. Lolumn Nomey
Sp- Kemame (Table Name
Neo Column Nama

En Sp-Remame Shiolernt.5Nama Studen-


NameS

B Syntaoc. to chonge a toble nama indotabase


Sp-Remame tCold table Nomo, Ne toble
Name'

B-Sp-Remama shudent', tshdem-detoils'


OR
Sp-Remame StudemtdeBails', 'shdemt
N) ALTER-DDp 8- DaDping a Column
t h e toblo pom
SmBaz -
ALte toble Toble Nama) Dtrop
Column Column Names
ALtem table Shudem Dop Column
Ant
mCaes eleing20 S from he toble but
motSmucTae ohe table. by USing tnmoate
mmam.d we Cam not delete a SpeCifc 200
Com the table because t dosemt Suppoat
Lwhea Clouse Comdihon
Symta hunCoBe toble <TableNarne
umcale doble Shudemt

DDp S Daopping o table fomo dotabase


peamamtl
Synta- DaDp table ZTable Nama7
D DDp table Shudem+3

DML (Data Momupulaion lamguage


Used to
CommamdS o a e
lhis Language
dato im database toble
Chomge 0t momipulaBe
1Insea msesing ane im to a
D
inSeat
methods to
table lhesc Ore tLoo
DLSS mto a table Inseshng cull
Method t
i>Implicit toble (wHhou
olumn'sindoa

Nolus fm all
elt amy Column) [ndu4TableName
Voluas

ymtac 8 Tnset
Nolue1, vala2, Nolala
Et-Cacote Hoble Shudent (STID nts SNo
Noscha Cuo), spee cdecimal (62), Age cma
hingint)
E
InSent: imtb Shdemt valuos Clol, SAI',
2500, 21
OR
TnGem shudem Volues (lo2 JAMES,
4so023)

i) Ecplidt Method 3-nsexing Nalucs


fo aequioccl Columns cnly Coith lefany
lumn in the toble
Syntoc
TrseE CINTO]
(TableNoma (Requied
olumn Nome3) Nalua9 Clo ALLEN')
HoLstoEoSemt Mulbple m 5into.cdable
5yntao for implicdt
Inses LINTOJ (TableName
Noluas, CRo2 voltos) NaluoS CRo
2
Insest into ShudemtNoluoS
(800,222, Clo5 Horsd', loy SCott
looo, 252
Syntox for bepl1ci+ -
Tnset[IHTO Tobledamo CRequizec
Name5) Values CLRowlNalues CRo02 olum
Nalues)
E nserectshudemt CSTED valbe.s Clo6), C1o3
Clo8

Updlate Aupdating all 20LS doata ina


toble at a ime ot a Specifc o . dcta
im a toble. by Using hene' Comdition
Sytoc
Update Table. Nama SET ColumnNcme 12
Nalte L , LColumnNamne2 2<value2)
- E Hheme Conditioni
a i t e a quemy updale employeajob as
HR Salay as 000 Whos emmpltye
Numbe 15 7788
HR, Salcay 400o
updotaemp Set Job c

Lhent EmpNo778B

Ei mte a quey o updale all emploje


Commiiom as 500
Set ComME So0
Updote Emp

DeleHe -Deleting al Dis omdha


Hable ot a hma or a specifc 20 rom
h e e Clause Cmdihon
tho table by Using
Syntaxk IHherelondibonJj
Delele from TableNommo.
Ec: bite a Queny o employe fon
deleBe

thetable. who ne woxing jn the jobis


Cleoa Cleamk
Delele vm Emp heae Job
Et mte a qu@y to deleteall emp
details m the fablee
DeleBe fom Emp
DiffeemCe berseom delete mdate.

Delete mmCoate
OTH is DL OPesatiom O Ttis DDL Opemationn
TH Com delete o Spedßc isnot Possible
D m tha table
TSuppot Hhere T+ dosent Suppoa
Clause Comdihiom Hhee clouse mdikon

tis the temmpomoy T s pemam


data deletiom.
dato delehon
Lle Cam 2cstoae e Con notocstoo
deleted doBo by Using deleted data by
mllback
]lbac USing
Ece.Cubon Speas is O btaCuion Spead
Slo is
fast

You might also like