<s>
In	O
database	O
theory	O
,	O
a	O
relation	O
,	O
as	O
originally	O
defined	O
by	O
E	O
.	O
F	O
.	O
Codd	O
,	O
is	O
a	O
set	O
of	O
tuples	B-Application
(	O
d1	O
,	O
d2	O
,...,	O
dn	O
)	O
,	O
where	O
each	O
element	O
dj	O
is	O
a	O
member	O
of	O
Dj	O
,	O
a	O
data	B-Application
domain	I-Application
.	O
</s>
<s>
Codd	O
's	O
original	O
definition	O
notwithstanding	O
,	O
and	O
contrary	O
to	O
the	O
usual	O
definition	O
in	O
mathematics	O
,	O
there	O
is	O
no	O
ordering	O
to	O
the	O
elements	O
of	O
the	O
tuples	B-Application
of	O
a	O
relation	O
.	O
</s>
<s>
An	O
attribute	O
value	O
is	O
an	O
attribute	O
name	O
paired	O
with	O
an	O
element	O
of	O
that	O
attribute	O
's	O
domain	O
,	O
and	O
a	O
tuple	B-Application
is	O
a	O
set	O
of	O
attribute	O
values	O
in	O
which	O
no	O
two	O
distinct	O
elements	O
have	O
the	O
same	O
name	O
.	O
</s>
<s>
Thus	O
,	O
in	O
some	O
accounts	O
,	O
a	O
tuple	B-Application
is	O
described	O
as	O
a	O
function	O
,	O
mapping	O
names	O
to	O
values	O
.	O
</s>
<s>
It	O
follows	O
from	O
the	O
above	O
definitions	O
that	O
to	O
every	O
tuple	B-Application
there	O
corresponds	O
a	O
unique	O
heading	O
,	O
being	O
the	O
set	O
of	O
names	O
from	O
the	O
tuple	B-Application
,	O
paired	O
with	O
the	O
domains	O
from	O
which	O
the	O
tuple	B-Application
's	O
domain	O
elements	O
are	O
taken	O
.	O
</s>
<s>
A	O
set	O
of	O
tuples	B-Application
that	O
all	O
correspond	O
to	O
the	O
same	O
heading	O
is	O
called	O
a	O
body	O
.	O
</s>
<s>
A	O
relation	O
is	O
thus	O
a	O
heading	O
paired	O
with	O
a	O
body	O
,	O
the	O
heading	O
of	O
the	O
relation	O
being	O
also	O
the	O
heading	O
of	O
each	O
tuple	B-Application
in	O
its	O
body	O
.	O
</s>
<s>
The	O
number	O
of	O
attributes	O
constituting	O
a	O
heading	O
is	O
called	O
the	O
degree	O
,	O
which	O
term	O
also	O
applies	O
to	O
tuples	B-Application
and	O
relations	O
.	O
</s>
<s>
The	O
term	O
n-tuple	O
refers	O
to	O
a	O
tuple	B-Application
of	O
degree	O
n	O
(	O
n	O
≥	O
0	O
)	O
.	O
</s>
<s>
E	O
.	O
F	O
.	O
Codd	O
used	O
the	O
term	O
"	O
relation	O
"	O
in	O
its	O
mathematical	O
sense	O
of	O
a	O
finitary	B-Algorithm
relation	I-Algorithm
,	O
a	O
set	O
of	O
tuples	B-Application
on	O
some	O
set	O
of	O
n	O
sets	O
S1	O
,	O
S2	O
,....	O
,	O
Sn	O
.	O
</s>
<s>
Thus	O
,	O
an	O
n-ary	B-Algorithm
relation	I-Algorithm
is	O
interpreted	O
,	O
under	O
the	O
Closed-World	B-Application
Assumption	I-Application
,	O
as	O
the	O
extension	O
of	O
some	O
n-adic	O
predicate	B-Algorithm
:	O
all	O
and	O
only	O
those	O
n-tuples	O
whose	O
values	O
,	O
substituted	O
for	O
corresponding	O
free	O
variables	O
in	O
the	O
predicate	B-Algorithm
,	O
yield	O
propositions	O
that	O
hold	O
true	O
,	O
appear	O
in	O
the	O
relation	O
.	O
</s>
<s>
The	O
term	O
relation	B-Language
schema	I-Language
refers	O
to	O
a	O
heading	O
paired	O
with	O
a	O
set	O
of	O
constraints	O
defined	O
in	O
terms	O
of	O
that	O
heading	O
.	O
</s>
<s>
A	O
relation	O
can	O
thus	O
be	O
seen	O
as	O
an	O
instantiation	O
of	O
a	O
relation	B-Language
schema	I-Language
if	O
it	O
has	O
the	O
heading	O
of	O
that	O
schema	B-Application
and	O
it	O
satisfies	O
the	O
applicable	O
constraints	O
.	O
</s>
<s>
Sometimes	O
a	O
relation	B-Language
schema	I-Language
is	O
taken	O
to	O
include	O
a	O
name	O
.	O
</s>
<s>
A	O
relational	O
database	O
definition	O
(	O
database	B-Application
schema	I-Application
,	O
sometimes	O
referred	O
to	O
as	O
a	O
relational	O
schema	B-Application
)	O
can	O
thus	O
be	O
thought	O
of	O
as	O
a	O
collection	O
of	O
named	O
relation	B-Language
schemas	I-Language
.	O
</s>
<s>
In	O
implementations	O
,	O
the	O
domain	O
of	O
each	O
attribute	O
is	O
effectively	O
a	O
data	O
type	O
and	O
a	O
named	O
relation	B-Language
schema	I-Language
is	O
effectively	O
a	O
relation	B-Application
variable	I-Application
(	O
relvar	B-Application
for	O
short	O
)	O
.	O
</s>
<s>
In	O
SQL	B-Language
,	O
a	O
database	O
language	O
for	O
relational	O
databases	O
,	O
relations	O
are	O
represented	O
by	O
tables	O
,	O
where	O
each	O
row	O
of	O
a	O
table	B-Application
represents	O
a	O
single	O
tuple	B-Application
,	O
and	O
where	O
the	O
values	O
of	O
each	O
attribute	O
form	O
a	O
column	O
.	O
</s>
<s>
A	O
predicate	B-Algorithm
for	O
this	O
relation	O
,	O
using	O
the	O
attribute	O
names	O
to	O
denote	O
free	O
variables	O
,	O
might	O
be	O
"	O
Employee	O
number	O
ID	O
is	O
known	O
as	O
Name	O
and	O
lives	O
at	O
Address	O
"	O
.	O
</s>
<s>
Examination	O
of	O
the	O
relation	O
tells	O
us	O
that	O
there	O
are	O
just	O
four	O
tuples	B-Application
for	O
which	O
the	O
predicate	B-Algorithm
holds	O
true	O
.	O
</s>
<s>
Under	O
the	O
definition	O
of	O
body	O
,	O
the	O
tuples	B-Application
of	O
a	O
body	O
do	O
not	O
appear	O
in	O
any	O
particular	O
order	O
-	O
one	O
cannot	O
say	O
"	O
The	O
tuple	B-Application
of	O
'	O
Murata	O
Makoto	O
 '	O
is	O
above	O
the	O
tuple	B-Application
of	O
'	O
Matsumoto	O
Yukihiro	O
 '	O
"	O
,	O
nor	O
can	O
one	O
say	O
"	O
The	O
tuple	B-Application
of	O
'	O
Yonezawa	O
Akinori	O
 '	O
is	O
the	O
first	O
tuple.	O
"	O
</s>
<s>
A	O
similar	O
comment	O
applies	O
to	O
the	O
rows	O
of	O
an	O
SQL	B-Application
table	I-Application
.	O
</s>
<s>
Under	O
the	O
definition	O
of	O
heading	O
,	O
the	O
attributes	O
of	O
an	O
element	O
do	O
not	O
appear	O
in	O
any	O
particular	O
order	O
either	O
,	O
nor	O
,	O
therefore	O
do	O
the	O
elements	O
of	O
a	O
tuple	B-Application
.	O
</s>
<s>
A	O
similar	O
comment	O
does	O
not	O
apply	O
here	O
to	O
SQL	B-Language
,	O
which	O
does	O
define	O
an	O
ordering	O
to	O
the	O
columns	O
of	O
a	O
table	B-Application
.	O
</s>
<s>
A	O
relational	O
database	O
consists	O
of	O
named	O
relation	B-Application
variables	I-Application
(	O
relvars	B-Application
)	O
for	O
the	O
purposes	O
of	O
updating	O
the	O
database	O
in	O
response	O
to	O
changes	O
in	O
the	O
real	O
world	O
.	O
</s>
<s>
An	O
update	O
to	O
a	O
single	O
relvar	B-Application
causes	O
the	O
body	O
of	O
the	O
relation	O
assigned	O
to	O
that	O
variable	O
to	O
be	O
replaced	O
by	O
a	O
different	O
set	O
of	O
tuples	B-Application
.	O
</s>
<s>
Relvars	B-Application
are	O
classified	O
into	O
two	O
classes	O
:	O
base	O
relation	B-Application
variables	I-Application
and	O
derived	O
relation	B-Application
variables	I-Application
,	O
the	O
latter	O
also	O
known	O
as	O
virtual	O
relvars	B-Application
but	O
usually	O
referred	O
to	O
by	O
the	O
short	O
term	O
view	O
.	O
</s>
<s>
A	O
base	O
relation	B-Application
variable	I-Application
is	O
a	O
relation	B-Application
variable	I-Application
which	O
is	O
not	O
derived	O
from	O
any	O
other	O
relation	B-Application
variables	I-Application
.	O
</s>
<s>
In	O
SQL	B-Language
the	O
term	O
base	O
table	B-Application
equates	O
approximately	O
to	O
base	O
relation	B-Application
variable	I-Application
.	O
</s>
<s>
A	O
view	O
can	O
be	O
defined	O
by	O
an	O
expression	O
using	O
the	O
operators	O
of	O
the	O
relational	B-Algorithm
algebra	I-Algorithm
or	O
the	O
relational	B-Application
calculus	I-Application
.	O
</s>
<s>
(	O
Note	O
that	O
the	O
expression	O
must	O
then	O
mention	O
at	O
least	O
one	O
base	O
relation	B-Application
variable	I-Application
.	O
)	O
</s>
<s>
By	O
using	O
a	O
Data	B-Language
Definition	I-Language
Language	I-Language
(	O
DDL	O
)	O
,	O
it	O
is	O
able	O
to	O
define	O
base	O
relation	B-Application
variables	I-Application
.	O
</s>
<s>
In	O
SQL	B-Language
,	O
CREATE	O
TABLE	B-Application
syntax	O
is	O
used	O
to	O
define	O
base	O
tables	O
.	O
</s>
<s>
The	O
Data	B-Language
Definition	I-Language
Language	I-Language
(	O
DDL	O
)	O
is	O
also	O
used	O
to	O
define	O
derived	O
relation	B-Application
variables	I-Application
.	O
</s>
<s>
In	O
SQL	B-Language
,	O
CREATE	O
VIEW	O
syntax	O
is	O
used	O
to	O
define	O
a	O
derived	O
relation	B-Application
variable	I-Application
.	O
</s>
