Sei sulla pagina 1di 8

Conspect la MySQL 10

MySQL Cuvintele cheie (rezervate).


ADD ALL ALTER ANALYZE AND AS
ASC BEFORE BETWEEN BIINT BINARY BLOB
BOT! BY CASCADE CASE C!ANE C!AR
C!ARACTER C!EC" COLLATE COL#MN COL#MNS CONSTRAINT
CON$ERT CREATE CROSS C#RRENT%DATE C#RRENT%TIME C#RRENT%TIMESTAM&
C#RRENT%#SER DATABASE DATABASES DAY%!O#R DAY%MICROSECOND DAY%MIN#TE
DAY%SECOND DEC DECIMAL DEFA#LT DELAYED DELETE
DESC DESCRIBE DISTINCT DISTINCTROW DI$ DO#BLE
DRO& D#AL ELSE ENCLOSED ESCA&ED E'ISTS
E'&LAIN FALSE FIELDS FLOAT FLOAT( FLOAT)
FOR FORCE FOREIN FROM F#LLTE'T RANT
RO#& !A$IN !I!%&RIORITY !O#R%MICROSECOND !O#R%MIN#TE !O#R%SECOND
IF INORE IN INDE' INFILE INNER
INSERT INT INT1 INT* INT+ INT(
INT) INTEER INTER$AL INTO IS ,OIN
"EY "EYS "ILL LEADIN LEFT LI"E
LIMIT LINES LOAD LOCALTIME LOCALTIMESTAM& LOC"
LON LONBLOB LONTE'T LOW%&RIORITY MATC! MEDI#MBLOB
MEDI#MINT MEDI#MTE'T MIDDLEINT MIN#TE%MICROSECOND MIN#TE%SECOND MOD
NAT#RAL NOT NO%WRITE%TO%BINLO N#LL N#MERIC ON
O&TIMIZE O&TION O&TIONALLY OR ORDER O#TER
O#TFILE &RECISION &RIMARY &RI$ILEES &ROCED#RE &#RE
RAID0 READ REAL REFERENCES REE'& RENAME
RE&LACE REQ#IRE RESTRICT RE$O"E RI!T RLI"E
SECOND%MICROSECOND SELECT SE&ARATOR SET S!OW SMALLINT
SONAME S&ATIAL SQL%BI%RES#LT SQL%CALC%FO#ND%ROWS SQL%SMALL%RES#LT SSL
STARTIN STRAI!T%,OIN TABLE TABLES TERMINATED T!EN
TINYBLOB TINYINT TINYTE'T TO TRAILIN TR#E
#NION #NIQ#E #NLOC" #NSINED #&DATE #SAE
#SE #SIN #TC%DATE #TC%TIME #TC%TIMESTAM& $AL#ES
$ARBINARY $ARC!AR $ARC!ARACTER $ARYIN W!EN W!ERE
WIT! WRITE '-0. 'OR YEAR%MONT! ZEROFILL
&a/0na 1 10n )
Conspect la MySQL 10
Tipurile de date.
NUMERICE: Fixe: NUMERIC2 DECIMAL2 INTEGER 30 SMALLINT 30 ap4o506at07e8 FLOAT2
REAL 30 DOUBLE PRECISION9 INT- sinonom pentru INTEGER2 1a4 DEC : pent4; DECIMAL9
s!r" DECIMAL#$%&' (!ori )e ! -**%** p<n= la **%** >***%**'+
DECIMAL#p' este ec?07alent c; DECIMAL#p%,' 30 ec?07alent DECIMAL+
INT#-'- se .or in)i/ - /i0re% )/1 se in)i/1 tri2utu! 3EROFILL2 po@0A00le l0Be4e
se co6pletea@= c; @e4o9 >INT#$' 3EROFILL2 7aloa4ea - se 7a aC03a ,,,,-9
Tip cte!i "e la La Tip cte!i "e la La
TINYINT 1 D1*) 1*E INT ( D*1(E()+F() *1(E()+F(E
SMALLINT * D+*EF) +*EFE BIINT ) D.**++E*0+F)-(EE-)0) .**++E*0+F)-(EE-)0E
MEDI#MINT + D)+))F0) )+))F0E
"#TE C#LEN"#RISTICE: DATETIME2 DATE2 TIMESTAMP2 TIME 30 4EAR9 F0eca4e 10n ele
poate a7ea 7alo404e 4espect07e 1a4 30 7aloa4ea G@e4oH2 ca4e se Colose3te2 c<n1 se 0nt4o1;ce 7aloa4e
0na160s0B0l=9 Datele se 0nt4o1;c In Co46at;l ANDL#NJDDATJ
Tipul $al%area &zer%' Tipul $al%area &zer%'
DATETIME 5,,,,-,,-,, ,,:,,:,,5 DATE 5,,,,-,,-,,5
TIME 5,,:,,:,,5
TIMESTAMP
,,,,,,,,,,,,,, >l;n/06ea 1ep0n1e
1e n;6=4;l 1e s06Bol;40 la 0e304eK 4EAR ,,,,
DATETIME c; Co46at;l 54444-MM-DD 66:MM:SS5 a4e 1o6en0;l 1e la 57,,,-,7-,7 ,,:,,:,,5
la 5****-7&-87 &8:$*:$*59
DATE D 54444-MM-DD5 57,,,-,7-,75 D 5****-7&-8759
Tipul (%r)atul Tipul (%r)atul Tipul (%r)atul
TIMESTAMP#7-' 4444MMDD66MMSS TIMESTAMP#7&' 44MMDD66MMSS TIMESTAMP#&' 44
TIMESTAMP#7,' 44MMDD66MM TIMESTAMP#9' 4444MMDD
TIMESTAMP#:' 44MMDD TIMESTAMP#-' 44MM
Datele 54444-MM-DD 66:MM:SS5 sa; 544-MM-DD 66:MM:SS5 pot C0 0nt4o1;se8 5*9-7&-87
77:8,:-$52 5*9+7&+87 77;8,;-$52 5*9<7&<87 77=8,=-$5 sa; 5*9>7&>87 77?8,?-$59
54444-MM-DD5 sa; 544-MM-DD5 D 5*9-7&-8752 5*9+7&+8752 5*9<7&<8752 5*9>7&>875
54444MMDD66MMSS5 sa; 544MMDD66MMSS5 - 57**@,$&8,*7$&95 sa; 5*@,$&8,*7$&95 se
s;BInAele/e 57**@-,$-&8 ,*:7$:&952 1a4 5*@77&&7&*,7$5 este 0na160s0B0l=2 C00n1c= 7aloa4ea
pent4; 60n;te este aBs;41= 30 7a p4060 7aloa4ea 5,,,,-,,-,, ,,:,,:,,59
TIME 566:MM:SS5 sa; 5666:MM:SS5 a4e 1o6en0;l 5-989:$*:$*5 p<n= 5989:$*:$*59
66MMSS2 7,777& D 57,:77:7&59
4EAR : 4444 .!ori )e ! 7*,7 p<n= la &7$$9 $a40ante8 57*,75 p<n= la 5&7$$5% / num1r )in
- /i0re 7*,7 D &7$$2 ca 304 5,,5 - 5**5 sa; n;6e4e 1e * c0C4e9 Ln acest ca@ 7alo40le 1e la 5,,5
p<n= la MF.M se t4ansCo46= In &,,, D &,:*&,,, 30 1e la 5@,5 la 5**5 In 7*@, D 7***9
&a/0na * 10n )
Conspect la MySQL 10
*IRURI "E C#R#CTERE8 C6AR2 (ARC6AR2 BLOB2 TEAT9
Tipul M+ri)ea )a, cte!i Tipul M+ri)ea )a, cte!i
TIN4TEAT sa;
TIN4BLOB
*N)D1 *--
MEDIUMTEAT sa;
MEDIUMBLOB
*N*(D1 >1FMD1K 1FEEE*1-
TEAT sa; BLOB *N1FD1 >F("D1K F--+-
LONGBLOB
*N+*D1 >(D1K (*.(.FE*.-
C6AR 30 (ARC6AR s;nt ase6=n=toa4e2 1a4 se 1eoseBesc p40n 6o1;l 1e p=st4a4e 30 aC03a4e9
Ln C6AR l;n/06ea c<6p;l;0 este constant=2 cea 0n10cat= la c4ea4e2 1e la 7#,' !
&$$/r/tere+ La sal7a4e la 14eapta se a1a;/= spaA009
(ARC6AR : 304;40 1e l;n/060 a4B0t4a4e >7 : &$$' 1a4 se p=st4ea@= n;6a0 c<te ca4acte4e a4e O 1
octet pent4; p=st4a4ea l;n/06009
M+ri)ea
C6AR#-'
Nece-ar )e)%rie
(ARC6AR#-'
Nece-ar )e)%rie
55 5 5
( octeA0
55
1 octet
525 52 5
( octeA0
525
+ octeA0
52/)5 52/)5
( octeA0
52/)5
- octeA0
52/)e0BC5 52/)5
( octeA0
52/)5
- octeA0
Dac= la c4ea4e n; a Cost 0n10cat at40B;t;l BINAR4 la so4ta4e 30 la co6pa4a4e n; se 7a A0ne cont 1e
4e/0st4;
TIN4BLOB2 BLOB2 MEDIUMBLOB 30 LONGBLOB Dpentru texte mri
TIN4TEAT2 TEAT2 MEDIUMTEAT 30 LONGTEAT D0Ce4enAa 10nt4e ele este c= la TE'T n; A0ne cont 1e
4e/0st4;9
Tipu! TEAT poate C0 cons01e4at ca (ARC6AR 1e 106ens0;n0 nel060tate 30 BLOB : ca (ARC6AR
BINAR49
C<6p;40le 1e t0p;40le BLOB 30 TEAT pot C0 0n1e5ate n;6a0 In 7e4s0;n0 MySQL +9*+9* 30 6a0 no09
N; poate C0 Colos0t at40B;t;l DEFAULT+
ENUMER#RE8 EN#M
EN#M>P;n;P2 P1o0P2 Pt4e0PK
M+ri)ea Inde, M+ri)ea Inde, M+ri)ea Inde, M+ri)ea Inde, M+ri)ea Inde,
NULL NULL EE
0
EIrinE
1
E(si!eE
*
ETtinE
+
Ma506;6 F--+- 1e ele6ente9 So4ta4ea 1;p= o410nea 10n l0st=9
MUL.IME8 SET
SET#Eto/E% E/reionE'NOT NULL poate p4060 7alo40le8 EE% Eto/E% E/reionE%
Eto/%/reionE+ &oate a7ea 6a506;6 F( 1e ele6ente9
Dac= a7e6 SET#EE%E2E%E/E%E)E'2 at;nc0 E%)E2 E)%E2 30 E)%%%)%)E este ca E%)E9
&a/0na + 10n )
Conspect la MySQL 10
NECES#RUL "E MEMRIE8
Tipul OcteA0 Tipul OcteA0
FLOAT#A' (2 1ac= ' QR *( o4 )2 1ac= *- QR ' QR -+ DECIMAL#M%D' M;&2 1ac= D S 02 M;72 1ac= D R 0 >DO*2 1ac= M F DK
FLOAT ( REAL )
DOUBLE )
NUMERIC#M%D' M;&2 1ac= D S 02 M;72 1ac= D R 0 >DO*2 1ac= M F DK
DOUBLE PRECISION )
DATE + TIMESTAMP ( DATETIME ) TIME + 4EAR 1
C6AR#M' M2 7 FG M FG &$$
(ARC6AR#M' LO12 ;n1e L FG M 30 7 FG M FG &$$
TIN4BLOB2 TIN4TEAT LO12 L Q *N)
BLOB2 TEAT LO*2 L Q *N1F
MEDIUMBLOB2 MEDIUMTEAT LO+2 L Q *N*(
LONGBLOB2 LONGTEAT LO(2 L Q *N+*
ENUM#5.!ue75%5.!ue&5%+++' 1 sa; *2 In 1epen1enA= 1e n;6=4;l 6=4060lo4 en;6e4ate >6a5 F--+-K
SET#5.!ue75%5.!ue&5%+++' 12 *2 +2 ( sa; )2 In 1epen1enA= 1e n;6=4;l 1e ele6ente a 6;lA0600 >6a59 F(K
&a/0na ( 10n )
Conspect la MySQL 10
Crearea /azei de date
CREATE DATABASE
CREATE DATABASE HIF NOT EAISTSI )2Jnme
Dac= BD e50st= 30 n; este 0n10cat pa4a6et4;l IF NOT EAISTS2 7a C0 e4oa4e9
BD In MySQL s;nt 4eal0@ate ca 6ape2 ce conA0n C030e4e2 ce 4ep4e@0nt= t=Bl0Aele9
F0eca4e taBl0A= a4e c<te + C030e4e c; e5tens00le +M4D2 M4I Ki +0rm9
!!!DROP DATABASE
DROP DATABASE HIF EAISTSI )2Jnme 3te4/e toate t=Bl0Aele 10n BD9
DROP DATABASE 3te4/e toate C030e4ele c; e5tens00le8 9BA"2 9DAT2 9!S!2 9ISD2 9ISM2 9ISM2
CREATE TABLE
CREATE HTEMPORAR4I TABLE HIF NOT EAISTSI t2!Jnme H#/reteJ)e0inition%+++'I
Ht2!eJoptionsI Hse!e/tJsttementI
Sa;
CREATE HTEMPORAR4I TABLE HIF NOT EAISTSI t2!Jnme LILE o!)Jt2!eJnmeM
/reteJ)e0inition:
/o!Jnme t"pe HNOT NULL N NULLI HDEFAULT )e0u!tJ.!ueI HAUTOJINCREMENTI
HPRIMAR4 LE4I Hre0eren/eJ)e0initionI
sa; PRIMAR4 LE4 #in)exJ/o!Jnme%+++'
sa; LE4 Hin)exJnmeI #in)exJ/o!Jnme%+++'
sa; INDEA Hin)exJnmeI #in)exJ/o!Jnme%+++'
sa; UNIOUE HINDEAI Hin)exJnmeI #in)exJ/o!Jnme%+++'
sa; FULLTEAT HINDEAI Hin)exJnmeI #in)exJ/o!Jnme%+++'
sa; HCONSTRAINT s"m2o!I FOREIGN LE4 Hin)exJnmeI #in)exJ/o!Jnme%+++'
Hre0eren/eJ)e0initionI
sa; C6ECL #expr'
t"pe: TIN4INTH#!enBtC'I HUNSIGNEDI H3EROFILLI
sa; SMALLINTH#!enBtC'I HUNSIGNEDI H3EROFILLI
sa; MEDIUMINTH#!enBtC'I HUNSIGNEDI H3EROFILLI
sa; INTH#!enBtC'I HUNSIGNEDI H3EROFILLI
sa; INTEGERH#!enBtC'I HUNSIGNEDI H3EROFILLI
sa; BIGINTH#!enBtC'I HUNSIGNEDI H3EROFILLI
sa; REALH#!enBtC%)e/im!s'I HUNSIGNEDI H3EROFILLI
sa; DOUBLEH#!enBtC%)e/im!s'I HUNSIGNEDI H3EROFILLI
sa; FLOATH#!enBtC%)e/im!s'I HUNSIGNEDI H3EROFILLI
sa; DECIMAL#!enBtC%)e/im!s' HUNSIGNEDI H3EROFILLI
sa; NUMERIC#!enBtC%)e/im!s' HUNSIGNEDI H3EROFILLI
sa; C6AR#!enBtC' HBINAR4I
sa; (ARC6AR#!enBtC' HBINAR4I
sa; DATE sa; TIME sa; TIMESTAMP sa; DATETIME sa; TIN4BLOB sa; BLOB sa;
MEDIUMBLOB sa; LONGBLOB sa; TIN4TEAT sa; TEAT sa; MEDIUMTEAT sa; LONGTEAT sa;
ENUM#.!ue7%.!ue&%.!ue8%+++' sa; SET#.!ue7%.!ue&%.!ue8%+++'
in)exJ/o!Jnme:
/o!Jnme H#!enBtC'I
re0eren/eJ)e0inition:
REFERENCES t2!Jnme H#in)exJ/o!Jnme%+++'I
HMATC6 FULL N MATC6 PARTIALI
HON DELETE re0eren/eJoptionI
HON UPDATE re0eren/eJoptionI
&a/0na - 10n )
Conspect la MySQL 10
re0eren/eJoption:
RESTRICT N CASCADE N SET NULL N NO ACTION N SET DEFAULT
t2!eJoptions:
T4PE G PBDB N 6EAP N ISAM N InnoDB N MERGE N MRGJM4ISAM N M4ISAM Q
sa; AUTOJINCREMENT G R m sa; A(GJROSJLENGT6 G R sa; C6ECLSUM G P, N 7Q
sa; COMMENT G EstrinBE sa; MAAJROSS G R sa;MINJROSS G R sa; PACLJLE4S G P, N 7
N DEFAULTQ sa; PASSSORD G EstrinBE sa; DELA4JLE4JSRITE G P, N 7Q
sa; ROSJFORMATG P )e0u!t N )"nmi/ N 0ixe) N /ompresse) Q
sa; RAIDJT4PEG P7 N STRIPED N RAID, Q RAIDJC6UNLSGR RAIDJC6UNLSI3EGR
sa; UNION G #t2!eJnme%Ht2!eJnme+++I'
sa; INSERTJMET6ODG PNO N FIRST N LAST Q
sa; DATA DIRECTOR4GEC!e )ep!in1E
TUT INDEA DIRECTOR4GE C!e )ep!in1 E
se!e/tJsttement:
HIGNORE N REPLACEI SELECT +++ #o40ce e5p4es0e co4ect= SELECT'
C<6p;l n;6e40c poate a7ea at40B;t;l AUTOJINCREMENT9 Lnt4D;n taBel n;6a0 ;n c<6p poate C0 c;
acest at40B;t9
DEFAULT t4eB;0e s= C0e o constant=9

ALTER TABLE
ALTER HIGNOREI TABLE t2!Jnme !terJspe/ H% !terJspe/ +++I
!terJspe/i0i/tion:
ADD HCOLUMNI /reteJ)e0inition HFIRST N AFTER /o!umnJnme I
sa; ADD HCOLUMNI #/reteJ)e0inition% /reteJ)e0inition%+++'
sa; ADD INDEA Hin)exJnmeI #in)exJ/o!Jnme%+++'
sa; ADD PRIMAR4 LE4 #in)exJ/o!Jnme%+++'
sa; ADD UNIOUE Hin)exJnmeI #in)exJ/o!Jnme%+++'
sa; ADD FULLTEAT Hin)exJnmeI #in)exJ/o!Jnme%+++'
sa; ADD HCONSTRAINT s"m2o!I FOREIGN LE4 Hin)exJnmeI #in)exJ/o!Jnme%+++'
Hre0eren/eJ)e0initionI
sa; ALTER HCOLUMNI /o!Jnme PSET DEFAULT !iter! N DROP DEFAULTQ
sa; C6ANGE HCOLUMNI o!)J/o!Jnme /reteJ)e0inition
HFIRST N AFTER /o!umnJnmeI
sa; MODIF4 HCOLUMNI /reteJ)e0inition HFIRST N AFTER /o!umnJnmeI
sa; DROP HCOLUMNI /o!Jnme sa; DROP PRIMAR4 LE4 sa; DROP INDEA in)exJnme
sa; DISABLE LE4S sa; ENABLE LE4S sa; RENAME HTOI neVJt2!Jnme sa; ORDER B4 /o!
sa; t2!eJoptions
Sc?06Ba4ea st4;ct;400 ;ne0 t=Bl0Ae e50stente9
m"sW!X ALTER TABLE t1 CHANGE a b INTEGER;
m"sW!X ALTER TABLE t1 CHANGE b b BIGINT NOT NULL;
m"sW!X ALTER TABLE t1 MODIFY b BIGINT NOT NULL;
m"sW!X CREATE TABLE t1 (a INTEGER,b CHAR(10));
m"sW!X ALTER TABLE t1 RENAME t2;
&ent4; a 6o10C0ca t0p;l 10n INTEGER pe TIN4INT NOT NULL >c; acela30 n;6eK 30 1e a sc?06Ba
t0p;l c<6p;l;0 2 10n C6AR#7,' pe C6AR#&,' 4e1en;60n1;Dl /8
m"sW!X ALTER TABLE t2 MODIFY a TINYINT NOT NULL, CHANGE b CHAR(20);
&a/0na F 10n )
Conspect la MySQL 10
&ent4; a a1=;/a ;n c<6p TIMESTAMP c; n;6ele )8
m"sW!X ALTER TABLE t2 ADD ! TIMESTAMP;
&ent4; a a1=;/a 0n1e5 la c<6p;l ) 30 1e 0n10cat la acest c<6p c?e0a p406a4=8
m"sW!X ALTER TABLE t2 ADD INDE" (!), ADD PRIMARY #EY (!);
&ent4; a 3te4/e c<6p;l /8
m"sW!X ALTER TABLE t2 DROP COLUMN ;
&ent4; a a1=;/a ;n c<6p no; n;6e40c AUTOJINCREMENT c; n;6ele /8
m"sW!X ALTER TABLE t2 ADD INT UNSIGNED NOT NULL AUTO$INCREMENT,
ADD INDEA #/'M
C<6p;40le 0n1e5ate n; pot C0 NULL9
RENAME TABLE
RENAME TABLE t2!Jnme TO neVJt2!JnmeH% t2!Jnme& TO neVJt2!Jnme&%+++I
DROP TABLE DROP HTEMPORAR4I TABLE HIF EAISTSI t2!Jnme H% t2!Jnme%+++I
HRESTRICT N CASCADEI
DROP TABLE 3te4/e ;na sa; 6a0 6;lte t=Bl0Ae
CREATE INDE"
CREATE HUNIOUENFULLTEATI INDEA in)exJnme
ON t2!Jnme #/o!JnmeH#!enBtC'I%+++ '
m"sW!X CREATE INDE" %a&t$'($)a*+ ON ,-t'*+& ()a*+(10));
DROP INDE"
DROP INDEA in)exJnme ON t2!Jnme
USE
USE )2Jnme USE )2Jnme Act07a4ea BD )2Jnme+ &oate C0 Colos0t= In ce4e40 p40n con7enA0e9
m"sW!X USE !b1;
m"sW!X SELECT COUNT(.) FROM */tab0+; 1 -+0+t- (&'* !b12*/tab0+
m"sW!X USE !b2;
m"sW!X SELECT COUNT(.) FROM */tab0+; 1 -+0+t- (&'* !b22*/tab0+
m"sW!X USE !b1;
m"sW!X SELECT a,t3'&$)a*+,+!4t'&$)a*+ FROM a,t3'&,!b22+!4t'&
S6ERE utCor+e)itorJi) G )2&+e)itor+e)itorJi)M
DESCRIBE
PDESCRIBE N DESCQ t2!Jnme H/o!Jnme N Vi!)I
DESCRIBE analo/ co6en@00 S6OS COLUMNS FROM9 OBA0ne6 0nCo46aA0a 1esp4e c<6p;40le t=Bl0Ae09
BEGIN5COMMIT5ROLLBAC#
&40n con7enA0e MySQL C;ncA0onea@= In 4e/06 uto/ommit9 Aceasta Insea6n= c= la 6o10C0ca4ea
1atelo4 a;to6at se Insc40; pe 10sc9
SET AUTOCOMMITG, D 1econectea@= 4e/06;l uto/ommit9
&ent4; a Insc40e 6o10C0c=40le pe 10sc t4eB;0e 1e Colos0t co6an1a COMMIT sa; co6an1a ROLLBACL2
ca4e ne 7a pe460te s= 0/no4=6 6o10C0c=40le2 eCect;ate 1e la Incep;t;l aceste0 t4an@acA009
&a/0na E 10n )
Conspect la MySQL 10
(unc!ii:
N%t+: Lnt4e n;6ele C;ncA0e0 30 pa4ante@e n; t4eB;0e s= C0e lac;ne9 Act07a4ea m"sW!) c; pa4a6et4;l
--nsi sa; CLIENTJIGNOREJSPACE Ln m"sW!J/onne/t#'2 ne pe460te s= a7e6 spaA00 Int4e
n;6ele C;ncA0e0 30 pa4ante@e9
m"sW!X SELECT MOD(26,6); -X &
m"sW!X SELECT 172.8; -X @ m"sW!X SELECT (172).8; -X *
Ope4ato400 1e co6pa4a4e 1a; In 4e@;ltat 7 >TR#EK2 , >FALSEK sa; NULL9
Dac= ;n a4/;6ent sa; a6Bele s;nt D NULL2 30 4e@;ltat;l este NULL9 >e5cepA0e FGX'9
Dac= a6Bele a4/;6ente s;nt 304;40 : se co6pa4= ca 304;40le9
Dac= a6Bele a4/;6ente s;nt n;6e4e Int4e/0 D se co6pa4= ca n;6e4ele Int4e/09
$alo40 ?esa@ec06ale 1ac= n; se co6pa4= c; n;6=4 se t4atea@= ca 304 c; 1ate B0na4e9
&40n con7enA0e : n; se A0ne cont 1e 4e/0st4;
m"sW!X SELECT 1 9 :;<:; -X , m"sW!X SELECT = 9 :;<:; -X 7
m"sW!X SELECT 0 9 :<;:; -X , m"sW!X SELECT 0 > :<;:; -X 7
m"sW!X SELECT 1 > 0; -X , m"sW!X SELECT :0: > 0; -X 7
m"sW!X SELECT :020: > 0; -X 7 m"sW!X SELECT :0201: > 0; -X ,
m"sW!X SELECT :201: > 0201; -X 7
m"sW!X SELECT :201: ?9 :0201:; -X 7 m"sW!X SELECT 201 ?9 :0201:; -X ,
m"sW!X SELECT :@a%%: ?9 :@a%%%:; -X 7
m"sW!X SELECT 021 ?> 2; -X 7 m"sW!X SELECT 2 ? 2; -X ,
m"sW!X SELECT 2 9> 2; -X 7 m"sW!X SELECT 2 9 2; -X ,
m"sW!X SELECT 1 ?>9 1, NULL ?>9 NULL, 1 ?>9 NULL; -X 7 7 ,
m"sW!X SELECT 1 IS NULL, 0 IS NULL, NULL IS NULL; -X , , 7
m"sW!X SELECT 1 IS NOT NULL, 0 IS NOT NULL, NULL IS NOT NULL; -X 7 7 ,
m"sW!X SELECT 1 BETAEEN 2 AND 8; -X ,
m"sW!X SELECT :b: BETAEEN :a: AND ::; -X 7
m"sW!X SELECT 2 BETAEEN 2 AND :8:; -X 7
m"sW!X SELECT 2 BETAEEN 2 AND :<B8:; -X ,
m"sW!X SELECT 2 IN (0,8,C,:D+(D(:); -X ,
m"sW!X SELECT :D+(D(: IN (0,8,C,:D+(D(:); -X 7
m"sW!X SELECT ISNULL(171); -X ,
m"sW!X SELECT ISNULL(150); -X 7
m"sW!X SELECT EaE >EA F)E; -X 7
m"sW!X SELECT NOT 10; -X ,
m"sW!X SELECT NOT 0; -X 7
m"sW!X SELECT NOT NULL; -X NULL
m"sW!X SELECT ! (171); -X ,
m"sW!X SELECT ! 171; -X 7
m"sW!X SELECT 1 GG 1; -X 7
m"sW!X SELECT 1 GG 0; -X ,
m"sW!X SELECT 1 GG NULL; -X NULL
m"sW!X SELECT 0 GG NULL; -X ,
m"sW!X SELECT NULL GG 0; -X ,
m"sW!X SELECT 1 HH 1; -X 7
m"sW!X SELECT 1 HH 0; -X 7
m"sW!X SELECT 0 HH 0; -X ,
m"sW!X SELECT 0 HH NULL; -X NULL
m"sW!X SELECT 1 HH NULL; -X 7
m"sW!X SELECT 1 "OR 1; -X ,
m"sW!X SELECT 1 "OR 0; -X 7
m"sW!X SELECT 1 "OR NULL; -X NULL
m"sW!X SELECT 1 "OR 1 "OR 1; -X 7
AOR 2 este ec?07alent # AND #NOT 2'' OR ##NOT ' n) 2'9
&a/0na ) 10n )