<s>
The	O
syntax	O
of	O
the	O
SQL	B-Language
programming	I-Language
language	I-Language
is	O
defined	O
and	O
maintained	O
by	O
ISO/IEC	O
SC	O
32	O
as	O
part	O
of	O
ISO/IEC	O
9075	O
.	O
</s>
<s>
Despite	O
the	O
existence	O
of	O
the	O
standard	O
,	O
SQL	B-Language
code	O
is	O
not	O
completely	O
portable	O
among	O
different	O
database	B-Application
systems	I-Application
without	O
adjustments	O
.	O
</s>
<s>
The	O
SQL	B-Language
language	I-Language
is	O
subdivided	O
into	O
several	O
language	O
elements	O
,	O
including	O
:	O
</s>
<s>
Keywords	O
are	O
words	O
that	O
are	O
defined	O
in	O
the	O
SQL	B-Language
language	I-Language
.	O
</s>
<s>
List	B-Language
of	I-Language
SQL	I-Language
reserved	I-Language
words	I-Language
.	O
</s>
<s>
Identifiers	O
are	O
names	O
on	O
database	O
objects	O
,	O
like	O
tables	B-Application
,	O
columns	B-Application
and	O
schemas	O
.	O
</s>
<s>
They	O
can	O
contain	O
characters	O
normally	O
not	O
supported	O
in	O
SQL	B-Language
identifiers	O
,	O
and	O
they	O
can	O
be	O
identical	O
to	O
a	O
reserved	O
word	O
,	O
e.g.	O
</s>
<s>
In	O
MySQL	B-Application
,	O
double	O
quotes	O
are	O
string	O
literal	O
delimiters	O
by	O
default	O
instead	O
.	O
</s>
<s>
Enabling	O
the	O
SQL	B-Language
mode	O
enforces	O
the	O
SQL	B-Language
standard	O
behavior	O
.	O
</s>
<s>
Clauses	O
,	O
which	O
are	O
constituent	O
components	O
of	O
statements	O
and	O
queries	B-Language
.	O
</s>
<s>
Predicates	O
,	O
which	O
specify	O
conditions	O
that	O
can	O
be	O
evaluated	O
to	O
SQL	B-Language
three-valued	B-Language
logic	I-Language
(	O
3VL	B-Language
)	O
(	O
true/false/unknown	O
)	O
or	O
Boolean	O
truth	O
values	O
and	O
are	O
used	O
to	O
limit	O
the	O
effects	O
of	O
statements	O
and	O
queries	B-Language
,	O
or	O
to	O
change	O
program	O
flow	O
.	O
</s>
<s>
Queries	B-Language
,	O
which	O
retrieve	O
the	O
data	O
based	O
on	O
specific	O
criteria	O
.	O
</s>
<s>
This	O
is	O
an	O
important	O
element	O
of	O
SQL	B-Language
.	O
</s>
<s>
SQL	B-Language
statements	O
also	O
include	O
the	O
semicolon	O
(";	O
"	O
)	O
statement	O
terminator	O
.	O
</s>
<s>
Though	O
not	O
required	O
on	O
every	O
platform	O
,	O
it	O
is	O
defined	O
as	O
a	O
standard	O
part	O
of	O
the	O
SQL	B-Language
grammar	O
.	O
</s>
<s>
Insignificant	O
whitespace	O
is	O
generally	O
ignored	O
in	O
SQL	B-Language
statements	O
and	O
queries	B-Language
,	O
making	O
it	O
easier	O
to	O
format	O
SQL	B-Language
code	O
for	O
readability	O
.	O
</s>
<s>
Other	O
operators	O
have	O
at	O
times	O
been	O
suggested	O
or	O
implemented	O
,	O
such	O
as	O
the	O
skyline	B-Language
operator	I-Language
(	O
for	O
finding	O
only	O
those	O
rows	B-Application
that	O
are	O
not	O
'	O
worse	O
 '	O
than	O
any	O
others	O
)	O
.	O
</s>
<s>
SQL	B-Language
has	O
the	O
expression	O
,	O
which	O
was	O
introduced	O
in	O
SQL-92	B-Language
.	O
</s>
<s>
In	O
its	O
most	O
general	O
form	O
,	O
which	O
is	O
called	O
a	O
"	O
searched	O
case	O
"	O
in	O
the	O
SQL	B-Language
standard	O
:	O
</s>
<s>
SQL	B-Language
tests	O
conditions	O
in	O
the	O
order	O
they	O
appear	O
in	O
the	O
source	O
.	O
</s>
<s>
If	O
the	O
source	O
does	O
not	O
specify	O
an	O
expression	O
,	O
SQL	B-Language
defaults	O
to	O
.	O
</s>
<s>
This	O
syntax	O
uses	O
implicit	O
equality	O
comparisons	O
,	O
with	O
the	O
usual	O
caveats	O
for	O
comparing	O
with	O
NULL	B-Language
.	O
</s>
<s>
The	O
expression	O
returns	O
the	O
value	O
of	O
the	O
first	O
non-NULL	O
operand	O
,	O
found	O
by	O
working	O
from	B-Language
left	O
to	O
right	O
,	O
or	O
NULL	B-Language
if	O
all	O
the	O
operands	O
equal	O
NULL	B-Language
.	O
</s>
<s>
The	O
expression	O
has	O
two	O
operands	O
and	O
returns	O
NULL	B-Language
if	O
the	O
operands	O
have	O
the	O
same	O
value	O
,	O
otherwise	O
it	O
has	O
the	O
value	O
of	O
the	O
first	O
operand	O
.	O
</s>
<s>
Standard	O
SQL	B-Language
allows	O
two	O
formats	O
for	O
comments	O
:	O
,	O
which	O
is	O
ended	O
by	O
the	O
first	O
newline	O
,	O
and	O
,	O
which	O
can	O
span	O
multiple	O
lines	O
.	O
</s>
<s>
The	O
most	O
common	O
operation	O
in	O
SQL	B-Language
,	O
the	O
query	B-Language
,	O
makes	O
use	O
of	O
the	O
declarative	O
SELECT	B-Language
statement	O
.	O
</s>
<s>
retrieves	O
data	O
from	B-Language
one	O
or	O
more	O
tables	B-Application
,	O
or	O
expressions	O
.	O
</s>
<s>
Some	O
non-standard	O
implementations	O
of	O
can	O
have	O
persistent	O
effects	O
,	O
such	O
as	O
the	O
syntax	O
provided	O
in	O
some	O
databases	B-Application
.	O
</s>
<s>
Queries	B-Language
allow	O
the	O
user	O
to	O
describe	O
desired	O
data	O
,	O
leaving	O
the	O
database	B-Application
management	I-Application
system	I-Application
(	O
DBMS	O
)	O
to	O
carry	O
out	O
planning	B-Language
,	O
optimizing	B-Language
,	O
and	O
performing	O
the	O
physical	O
operations	O
necessary	O
to	O
produce	O
that	O
result	O
as	O
it	O
chooses	O
.	O
</s>
<s>
A	O
query	B-Language
includes	O
a	O
list	O
of	O
columns	B-Application
to	O
include	O
in	O
the	O
final	O
result	O
,	O
normally	O
immediately	O
following	O
the	O
keyword	O
.	O
</s>
<s>
An	O
asterisk	O
("*"	O
)	O
can	O
be	O
used	O
to	O
specify	O
that	O
the	O
query	B-Language
should	O
return	O
all	O
columns	B-Application
of	O
the	O
queried	O
tables	B-Application
.	O
</s>
<s>
is	O
the	O
most	O
complex	O
statement	O
in	O
SQL	B-Language
,	O
with	O
optional	O
keywords	O
and	O
clauses	O
that	O
include	O
:	O
</s>
<s>
The	O
FROM	B-Language
clause	O
,	O
which	O
indicates	O
the	O
table(s )	O
to	O
retrieve	O
data	O
from	B-Language
.	O
</s>
<s>
The	O
clause	O
can	O
include	O
optional	O
JOIN	B-Language
subclauses	O
to	O
specify	O
the	O
rules	O
for	O
joining	O
tables	B-Application
.	O
</s>
<s>
The	O
WHERE	B-Language
clause	O
includes	O
a	O
comparison	O
predicate	O
,	O
which	O
restricts	O
the	O
rows	B-Application
returned	O
by	O
the	O
query	B-Language
.	O
</s>
<s>
The	O
clause	O
eliminates	O
all	O
rows	B-Application
from	B-Language
the	O
result	B-Application
set	I-Application
where	B-Language
the	O
comparison	O
predicate	O
does	O
not	O
evaluate	O
to	O
True	O
.	O
</s>
<s>
The	O
GROUP	B-Language
BY	I-Language
clause	O
projects	O
rows	B-Application
having	B-Language
common	O
values	O
into	O
a	O
smaller	O
set	O
of	O
rows	B-Application
.	O
</s>
<s>
is	O
often	O
used	O
in	O
conjunction	O
with	O
SQL	B-Language
aggregation	O
functions	O
or	O
to	O
eliminate	O
duplicate	O
rows	B-Application
from	B-Language
a	O
result	B-Application
set	I-Application
.	O
</s>
<s>
The	O
HAVING	B-Language
clause	O
includes	O
a	O
predicate	O
used	O
to	O
filter	O
rows	B-Application
resulting	O
from	B-Language
the	O
clause	O
.	O
</s>
<s>
The	O
ORDER	B-Language
BY	I-Language
clause	O
identifies	O
which	O
column[s]	O
to	O
use	O
to	O
sort	O
the	O
resulting	O
data	O
,	O
and	O
in	O
which	O
direction	O
to	O
sort	O
them	O
(	O
ascending	O
or	O
descending	O
)	O
.	O
</s>
<s>
Without	O
an	O
clause	O
,	O
the	O
order	O
of	O
rows	B-Application
returned	O
by	O
an	O
SQL	B-Language
query	I-Language
is	O
undefined	O
.	O
</s>
<s>
The	O
clause	O
specifies	O
the	O
number	O
of	O
rows	B-Application
to	O
skip	O
before	O
starting	O
to	O
return	O
data	O
.	O
</s>
<s>
The	O
clause	O
specifies	O
the	O
number	O
of	O
rows	B-Application
to	O
return	O
.	O
</s>
<s>
Some	O
SQL	B-Language
databases	I-Language
instead	O
have	O
non-standard	O
alternatives	O
,	O
e.g.	O
</s>
<s>
The	O
clauses	O
of	O
a	O
query	B-Language
have	O
a	O
particular	O
order	O
of	O
execution	O
,	O
which	O
is	O
denoted	O
by	O
the	O
number	O
on	O
the	O
right	O
hand	O
side	O
.	O
</s>
<s>
SELECT	B-Language
<columns>	O
5	O
.	O
</s>
<s>
FROM	B-Language
<table>	O
1	O
.	O
</s>
<s>
WHERE	B-Language
<predicate on rows>	O
2	O
.	O
</s>
<s>
GROUP	B-Language
BY	I-Language
<columns>	O
3	O
.	O
</s>
<s>
HAVING	B-Language
<predicate on groups>	O
4	O
.	O
</s>
<s>
ORDER	B-Language
BY	I-Language
<columns>	O
6	O
.	O
</s>
<s>
The	O
following	O
example	O
of	O
a	O
query	B-Language
returns	O
a	O
list	O
of	O
expensive	O
books	O
.	O
</s>
<s>
The	O
query	B-Language
retrieves	O
all	O
rows	B-Application
from	B-Language
the	O
Book	O
table	B-Application
in	O
which	O
the	O
price	O
column	O
contains	O
a	O
value	O
greater	O
than	O
100.00	O
.	O
</s>
<s>
The	O
result	O
is	O
sorted	O
in	O
ascending	O
order	B-Language
by	I-Language
title	O
.	O
</s>
<s>
The	O
asterisk	O
( *	O
)	O
in	O
the	O
select	B-Language
list	O
indicates	O
that	O
all	O
columns	B-Application
of	O
the	O
Book	O
table	B-Application
should	O
be	O
included	O
in	O
the	O
result	B-Application
set	I-Application
.	O
</s>
<s>
The	O
example	O
below	O
demonstrates	O
a	O
query	B-Language
of	O
multiple	O
tables	B-Application
,	O
grouping	O
,	O
and	O
aggregation	O
,	O
by	O
returning	O
a	O
list	O
of	O
books	O
and	O
the	O
number	O
of	O
authors	O
associated	O
with	O
each	O
book	O
.	O
</s>
<s>
Under	O
the	O
precondition	O
that	O
isbn	O
is	O
the	O
only	O
common	O
column	O
name	O
of	O
the	O
two	O
tables	B-Application
and	O
that	O
a	O
column	O
named	O
title	O
only	O
exists	O
in	O
the	O
Book	O
table	B-Application
,	O
one	O
could	O
re-write	O
the	O
query	B-Language
above	O
in	O
the	O
following	O
form	O
:	O
</s>
<s>
SQL	B-Language
includes	O
operators	O
and	O
functions	O
for	O
calculating	O
values	O
on	O
stored	O
values	O
.	O
</s>
<s>
SQL	B-Language
allows	O
the	O
use	O
of	O
expressions	O
in	O
the	O
select	B-Language
list	O
to	O
project	O
data	O
,	O
as	O
in	O
the	O
following	O
example	O
,	O
which	O
returns	O
a	O
list	O
of	O
books	O
that	O
cost	O
more	O
than	O
100.00	O
with	O
an	O
additional	O
sales_tax	O
column	O
containing	O
a	O
sales	O
tax	O
figure	O
calculated	O
at	O
6%	O
of	O
the	O
price	O
.	O
</s>
<s>
Queries	B-Language
can	O
be	O
nested	O
so	O
that	O
the	O
results	O
of	O
one	O
query	B-Language
can	O
be	O
used	O
in	O
another	O
query	B-Language
via	O
a	O
relational	O
operator	O
or	O
aggregation	O
function	O
.	O
</s>
<s>
A	O
nested	O
query	B-Language
is	O
also	O
known	O
as	O
a	O
subquery	O
.	O
</s>
<s>
While	O
joins	O
and	O
other	O
table	B-Application
operations	O
provide	O
computationally	O
superior	O
(	O
i.e.	O
</s>
<s>
A	O
subquery	O
can	O
use	O
values	O
from	B-Language
the	O
outer	O
query	B-Language
,	O
in	O
which	O
case	O
it	O
is	O
known	O
as	O
a	O
correlated	B-Language
subquery	I-Language
.	O
</s>
<s>
Since	O
1999	O
the	O
SQL	B-Language
standard	O
allows	O
clauses	O
for	O
subqueries	O
,	O
i.e.	O
</s>
<s>
named	O
subqueries	O
,	O
usually	O
called	O
common	O
table	B-Application
expressions	O
(	O
also	O
called	O
subquery	B-Language
factoring	I-Language
)	O
.	O
</s>
<s>
CTEs	O
can	O
also	O
be	O
recursive	O
by	O
referring	O
to	O
themselves	O
;	O
the	B-Language
resulting	I-Language
mechanism	I-Language
allows	O
tree	O
or	O
graph	O
traversals	O
(	O
when	O
represented	O
as	O
relations	O
)	O
,	O
and	O
more	O
generally	O
fixpoint	O
computations	O
.	O
</s>
<s>
A	O
derived	O
table	B-Application
is	O
the	O
use	O
of	O
referencing	O
an	O
SQL	B-Language
subquery	O
in	O
a	O
FROM	B-Language
clause	O
.	O
</s>
<s>
Essentially	O
,	O
the	O
derived	O
table	B-Application
is	O
a	O
subquery	O
that	O
can	O
be	O
selected	O
from	B-Language
or	O
joined	O
to	O
.	O
</s>
<s>
The	O
derived	O
table	B-Application
functionality	O
allows	O
the	O
user	O
to	O
reference	O
the	O
subquery	O
as	O
a	O
table	B-Application
.	O
</s>
<s>
In	O
the	O
following	O
example	O
,	O
the	O
SQL	B-Language
statement	O
involves	O
a	O
join	B-Language
from	B-Language
the	O
initial	O
"	O
Book	O
"	O
table	B-Application
to	O
the	O
derived	O
table	B-Application
"	O
sales	O
"	O
.	O
</s>
<s>
This	O
derived	O
table	B-Application
captures	O
associated	O
book	O
sales	O
information	O
using	O
the	O
ISBN	O
to	O
join	B-Language
to	O
the	O
"	O
Book	O
"	O
table	B-Application
.	O
</s>
<s>
As	O
a	O
result	O
,	O
the	O
derived	O
table	B-Application
provides	O
the	O
result	B-Application
set	I-Application
with	O
additional	O
columns	B-Application
(	O
the	O
number	O
of	O
items	O
sold	O
and	O
the	O
company	O
that	O
sold	O
the	O
books	O
)	O
:	O
</s>
<s>
The	O
concept	O
of	O
Null	B-Language
allows	O
SQL	B-Language
to	O
deal	O
with	O
missing	O
information	O
in	O
the	O
relational	O
model	O
.	O
</s>
<s>
The	O
word	O
is	O
a	O
reserved	O
keyword	O
in	O
SQL	B-Language
,	O
used	O
to	O
identify	O
the	O
Null	B-Language
special	O
marker	O
.	O
</s>
<s>
Comparisons	O
with	O
Null	B-Language
,	O
for	O
instance	O
equality	O
(=	O
)	O
in	O
WHERE	B-Language
clauses	O
,	O
results	O
in	O
an	O
Unknown	O
truth	O
value	O
.	O
</s>
<s>
In	O
SELECT	B-Language
statements	O
SQL	B-Language
returns	O
only	O
results	O
for	O
which	O
the	O
WHERE	B-Language
clause	O
returns	O
a	O
value	O
of	O
True	O
;	O
i.e.	O
,	O
it	O
excludes	O
results	O
with	O
values	O
of	O
False	O
and	O
also	O
excludes	O
those	O
whose	O
value	O
is	O
Unknown	O
.	O
</s>
<s>
Along	O
with	O
True	O
and	O
False	O
,	O
the	O
Unknown	O
resulting	O
from	B-Language
direct	O
comparisons	O
with	O
Null	B-Language
thus	O
brings	O
a	O
fragment	O
of	O
three-valued	B-Language
logic	I-Language
to	O
SQL	B-Language
.	O
</s>
<s>
The	O
truth	O
tables	B-Application
SQL	B-Language
uses	O
for	O
AND	O
,	O
OR	O
,	O
and	O
NOT	O
correspond	O
to	O
a	O
common	O
fragment	O
of	O
the	O
Kleene	O
and	O
Lukasiewicz	O
three-valued	B-Language
logic	I-Language
(	O
which	O
differ	O
in	O
their	O
definition	O
of	O
implication	O
,	O
however	O
SQL	B-Language
defines	O
no	O
such	O
operation	O
)	O
.	O
</s>
<s>
There	O
are	O
however	O
disputes	O
about	O
the	O
semantic	O
interpretation	O
of	O
Nulls	B-Language
in	O
SQL	B-Language
because	O
of	O
its	O
treatment	O
outside	O
direct	O
comparisons	O
.	O
</s>
<s>
This	O
is	O
in	O
line	O
with	O
the	O
interpretation	O
that	O
Null	B-Language
does	O
not	O
have	O
a	O
value	O
(	O
and	O
is	O
not	O
a	O
member	O
of	O
any	O
data	O
domain	O
)	O
but	O
is	O
rather	O
a	O
placeholder	O
or	O
"	O
mark	O
"	O
for	O
missing	O
information	O
.	O
</s>
<s>
However	O
,	O
the	O
principle	O
that	O
two	O
Nulls	B-Language
are	O
n't	O
equal	O
to	O
each	O
other	O
is	O
effectively	O
violated	O
in	O
the	O
SQL	B-Language
specification	O
for	O
the	O
and	O
operators	O
,	O
which	O
do	O
identify	O
nulls	B-Language
with	O
each	O
other	O
.	O
</s>
<s>
Consequently	O
,	O
these	O
set	B-Language
operations	I-Language
in	I-Language
SQL	I-Language
may	O
produce	O
results	O
not	O
representing	O
sure	O
information	O
,	O
unlike	O
operations	O
involving	O
explicit	O
comparisons	O
with	O
NULL	B-Language
(	O
e.g.	O
</s>
<s>
In	O
Codd	O
's	O
1979	O
proposal	O
(	O
which	O
was	O
basically	O
adopted	O
by	O
SQL92	B-Language
)	O
this	O
semantic	O
inconsistency	O
is	O
rationalized	O
by	O
arguing	O
that	O
removal	O
of	O
duplicates	O
in	O
set	B-Language
operations	I-Language
happens	O
"	O
at	O
a	O
lower	O
level	O
of	O
detail	O
than	O
equality	O
testing	O
in	O
the	O
evaluation	O
of	O
retrieval	O
operations	O
"	O
.	O
</s>
<s>
However	O
,	O
computer-science	O
professor	O
Ron	O
van	O
der	O
Meyden	O
concluded	O
that	O
"	O
The	O
inconsistencies	O
in	O
the	O
SQL	B-Language
standard	O
mean	O
that	O
it	O
is	O
not	O
possible	O
to	O
ascribe	O
any	O
intuitive	O
logical	O
semantics	O
to	O
the	O
treatment	O
of	O
nulls	B-Language
in	O
SQL.	O
"	O
</s>
<s>
Additionally	O
,	O
because	O
SQL	B-Language
operators	O
return	O
Unknown	O
when	O
comparing	O
anything	O
with	O
Null	B-Language
directly	O
,	O
SQL	B-Language
provides	O
two	O
Null-specific	O
comparison	O
predicates	O
:	O
and	O
test	O
whether	O
data	O
is	O
or	O
is	O
not	O
Null	B-Language
.	O
</s>
<s>
SQL	B-Language
does	O
not	O
explicitly	O
support	O
universal	O
quantification	O
,	O
and	O
must	O
work	O
it	O
out	O
as	O
a	O
negated	O
existential	B-Algorithm
quantification	I-Algorithm
.	O
</s>
<s>
There	O
is	O
also	O
the	O
infixed	O
comparison	O
operator	O
,	O
which	O
returns	O
TRUE	O
unless	O
both	O
operands	O
are	O
equal	O
or	O
both	O
are	O
NULL	B-Language
.	O
</s>
<s>
Likewise	O
,	O
IS	O
NOT	O
DISTINCT	O
FROM	B-Language
is	O
defined	O
as	O
.	O
</s>
<s>
SQL:1999	B-Language
also	O
introduced	O
type	O
variables	O
,	O
which	O
according	O
to	O
the	O
standard	O
can	O
also	O
hold	O
Unknown	O
values	O
if	O
it	O
is	O
nullable	O
.	O
</s>
<s>
PostgreSQL	B-Application
)	O
implement	O
the	O
BOOLEAN	O
Unknown	O
as	O
a	O
BOOLEAN	O
NULL	B-Language
,	O
which	O
the	O
standard	O
says	O
that	O
the	O
NULL	B-Language
BOOLEAN	O
and	O
UNKNOWN	O
"	O
may	O
be	O
used	O
interchangeably	O
to	O
mean	O
exactly	O
the	O
same	O
thing	O
"	O
.	O
</s>
<s>
The	O
Data	B-Language
Manipulation	I-Language
Language	I-Language
(	O
DML	O
)	O
is	O
the	O
subset	O
of	O
SQL	B-Language
used	O
to	O
add	O
,	O
update	B-Language
and	O
delete	B-Language
data	O
:	O
</s>
<s>
INSERT	B-Language
adds	O
rows	B-Application
(	O
formally	O
tuples	B-Application
)	O
to	O
an	O
existing	O
table	B-Application
,	O
e.g.	O
</s>
<s>
UPDATE	B-Language
modifies	O
a	O
set	O
of	O
existing	O
table	B-Application
rows	I-Application
,	O
e.g.	O
</s>
<s>
DELETE	B-Language
removes	O
existing	O
rows	B-Application
from	B-Language
a	O
table	B-Application
,	O
e.g.	O
</s>
<s>
MERGE	B-Language
is	O
used	O
to	O
combine	O
the	O
data	O
of	O
multiple	O
tables	B-Application
.	O
</s>
<s>
It	O
is	O
defined	O
in	O
the	O
SQL:2003	O
standard	O
;	O
prior	O
to	O
that	O
,	O
some	O
databases	B-Application
provided	O
similar	O
functionality	O
via	O
different	O
syntax	O
,	O
sometimes	O
called	O
"	O
upsert	B-Language
"	O
.	O
</s>
<s>
(	O
or	O
,	O
or	O
,	O
depending	O
on	O
SQL	B-Language
dialect	O
)	O
marks	O
the	O
start	O
of	O
a	O
database	B-General_Concept
transaction	I-General_Concept
,	O
which	O
either	O
completes	O
entirely	O
or	O
not	O
at	O
all	O
.	O
</s>
<s>
COMMIT	B-Language
makes	O
all	O
data	O
changes	O
in	O
a	O
transaction	O
permanent	O
.	O
</s>
<s>
ROLLBACK	B-Application
discards	O
all	O
data	O
changes	O
since	O
the	O
last	O
or	O
,	O
leaving	O
the	O
data	O
as	O
it	O
was	O
prior	O
to	O
those	O
changes	O
.	O
</s>
<s>
In	O
the	O
absence	O
of	O
a	O
or	O
similar	O
statement	O
,	O
the	O
semantics	O
of	O
SQL	B-Language
are	O
implementation-dependent	O
.	O
</s>
<s>
The	O
following	O
example	O
shows	O
a	O
classic	O
transfer	O
of	O
funds	O
transaction	O
,	O
where	B-Language
money	O
is	O
removed	O
from	B-Language
one	O
account	O
and	O
added	O
to	O
another	O
.	O
</s>
<s>
The	O
Data	B-Language
Definition	I-Language
Language	I-Language
(	O
DDL	O
)	O
manages	O
table	B-Application
and	O
index	O
structure	O
.	O
</s>
<s>
CREATE	O
creates	O
an	O
object	O
(	O
a	O
table	B-Application
,	O
for	O
example	O
)	O
in	O
the	O
database	O
,	O
e.g.	O
</s>
<s>
ALTER	O
modifies	O
the	O
structure	O
of	O
an	O
existing	O
object	O
in	O
various	O
ways	O
,	O
for	O
example	O
,	O
adding	O
a	O
column	O
to	O
an	O
existing	O
table	B-Application
or	O
a	O
constraint	O
,	O
e.g.	O
</s>
<s>
TRUNCATE	B-Language
deletes	B-Language
all	O
data	O
from	B-Language
a	O
table	B-Application
in	O
a	O
very	O
fast	O
way	O
,	O
deleting	O
the	O
data	O
inside	O
the	O
table	B-Application
and	O
not	O
the	O
table	B-Application
itself	O
.	O
</s>
<s>
It	O
usually	O
implies	O
a	O
subsequent	O
COMMIT	B-Language
operation	O
,	O
i.e.	O
,	O
it	O
cannot	O
be	O
rolled	O
back	O
(	O
data	O
is	O
not	O
written	O
to	O
the	O
logs	O
for	O
rollback	B-Application
later	O
,	O
unlike	O
DELETE	B-Language
)	O
.	O
</s>
<s>
DROP	O
deletes	B-Language
an	O
object	O
in	O
the	O
database	O
,	O
usually	O
irretrievably	O
,	O
i.e.	O
,	O
it	O
cannot	O
be	O
rolled	O
back	O
,	O
e.g.	O
</s>
<s>
Each	O
column	O
in	O
an	O
SQL	B-Application
table	I-Application
declares	O
the	O
type(s )	O
that	O
column	O
may	O
contain	O
.	O
</s>
<s>
ANSI	O
SQL	B-Language
includes	O
the	O
following	O
data	O
types	O
.	O
</s>
<s>
SQL	B-Language
provides	O
the	O
functions	O
and	O
to	O
round	O
numerical	O
values	O
.	O
</s>
<s>
The	O
SQL	B-Language
function	O
can	O
be	O
used	O
for	O
extracting	O
a	O
single	O
field	O
(	O
seconds	O
,	O
for	O
instance	O
)	O
of	O
a	O
datetime	O
or	O
interval	O
value	O
.	O
</s>
<s>
The	O
Data	B-Application
Control	I-Application
Language	I-Application
(	O
DCL	O
)	O
authorizes	O
users	O
to	O
access	O
and	O
manipulate	O
data	O
.	O
</s>
