IMPLEMENT ARITHMETIC E xe RESSIONS , RELATIONSHg|
pate + EXPRESSION, CHARACTER EXPRESSION AND CHARA CIOR
PATTERN Matcninh IN SQL QUERIES
Aim
To implement avithmetic €apressions , velabionSh; p
expression , cthovactoy expresien and characte pall eyn
matching fo SQL qverils -
. Create a Eable 'marks’ with the albxibules +
Stedent 1d, mi,m2,m3
* mSert 5 secovds
* Execote all avithmelic Cxpressions .
2. Create a Cable ' customers’ with altrbles +
CustomerID, Customey wame, City, country
+ Insert 5 vecovds .
x Execute AND, 6R, Not, Lit E not uke
2. Execut? Charackhe, expressions -
SOFTWARE REQUIREMENT
microsogt SQL Server
ORitHmeE TIC EXPRESSIONS
Marty
Minly
Average 0)
Count C)
nee torrentSom C)
Powe RC)
Léenata 0
Row) CO
Sort
A&C
Frook (
CEILINGY
RELATIONSHIP EXPRESSION
LOGICAL OPERATORS : AND, OR and NoT OPERATORS
X “The WHERE Clavse Can be Combined with Awd, OR 444
Not oerxrabors *
Operators ave vsed bo gijkey
x The AND ond OR
on mort than on€ Cond bron -
yecovds based
¥ The AMD optraber displogs a *ecord ff all the
Cond sbvens Separeted by AND IS TY¥E +
¥ The OR Operoter displayS a yecord %{ any X the
Cond/bions Seperated by OR 1S TRUE
¥ The NOM Operober Aisplays a ‘Yecovd if the
Conds Events) 15 Met TRUE -
RELATIONAL OPERATORS
= Kee eeeCHARACTER EXPRESSION
(DPPER C)
LoweR Q
RePLAce Cy
SuBs TRING C)
CHARACTER PATTERN MATCHING
LikE OPERATOR
X The LiKE OPERATOR IS VSed 1s 0 wHhERE clavse Lo
Seo¥ch fey o specgied polkern m 4 coleman -
% GRRE Wome [eive aicsid cones mused 0A conjunckron
wilh he Live opeve ter *
% J pearsacene: Sig apres =e coc
mlbiple Choxach erS ~
vepresenkS & Srng le
~ ee, on derScoxe
Chazocé ex’
Ovteu T -
ARIHMEVIC ENP ESS: on
RELATIONSHIP EW PRESSVON
CHRRA GER EXPRESSION
(Wa
CHARReTER PATTERN marcHin gyoreerer a 4
m mn S EROT PAE
avvaaseo 78 aa
ras Oe Kies panier? g8 aw> gree! gaeHe
’ "
cei) & histo SxP 2 x75 Q” AD gar ‘
ee Gee eT Geom peend
\ aie gv ere te pe periarit cader9gc Abt
~BeKt ZG et
Moret & Zs inch
i nail yeosr sealCHARACTER EXPRESSION
(PPER (>
lLoweR 0
REPLACE (Cy
SuBs TRING ()
%
CHARACTER PATTERN MAT CHIMG
Like OPERATOR
* The KE OPERATOR IS Used JA
O WHERE clause bo
$eo%ch for a speci ied Pott ern mm 4 column -
¥ There Ort Ewo Widcards LSed ra Conjunckion
Me we Operetor :
ai ~ The perscene Srgn SepreseatS Zeyxo, One, oy
ple chorach ers +
peer e 07 dey scoye Yepsesenks a Sing le
Ete oach ey-INSERTING RECORDS i Hic
insext into sudent wulues (1, 'Priyg 4 ‘0rT ’, gpa, ‘cee’)
msec mabe Sbodeal valoes (2, ‘shytht”, 'baT’”, Go, 40,'¢M)
yasert ral-o SteehenG values ( 3, ‘Jitu Ie 3 19, 90, 'Te')
mservt sabo Stedeal valves a, vin 2° Dee , 36, 40 aty)
Insevé sake
Stedeul valor U5 “Janshy a ‘new, 9660 ‘kar’
Bemece ~ brom slodeat -
£ mn (maths) from skvdeat
Max (mdhs) from stedeal
maths) from sculenl
hs) (xem stodeatRovnd ohh
\253
4. 2dbo arses
‘ a
abRound
ee Pt Dade
Selece SQRt (25)
Selec’ PBS (~26)
Fleey
Beet thick ( 12.44) see
Ceiling
Selecy CEilme (12-45) " ceiling
| bPpey
é Select vppey ( “infermakion “) typpey'g :
Lowey ( 'WkoRMATION’) "Ion ty’ +
REPLACE Cran ee 1 We)
fen ( ydbms ‘Jd ‘Leng TA i
@E find dept = Dale
Grky e KageWhere NoT
4
where python Between bo and GO
hove Mp
ple meak ayslhmebic
a Ship — Pxpression ,
Char a¢ 6 oy Ppatle
a