<s>
The	O
relational	B-Application
calculus	I-Application
consists	O
of	O
two	O
calculi	O
,	O
the	O
tuple	B-Application
relational	I-Application
calculus	I-Application
and	O
the	O
domain	B-Application
relational	I-Application
calculus	I-Application
,	O
that	O
is	O
part	O
of	O
the	O
relational	B-Architecture
model	I-Architecture
for	O
databases	O
and	O
provide	O
a	O
declarative	O
way	O
to	O
specify	O
database	O
queries	O
.	O
</s>
<s>
The	O
raison	O
d'être	O
of	O
relational	B-Application
calculus	I-Application
is	O
the	O
formalization	O
of	O
query	B-Language
optimization	I-Language
,	O
which	O
is	O
finding	O
more	O
efficient	O
manners	O
to	O
execute	O
the	O
same	O
query	O
in	O
a	O
database	O
.	O
</s>
<s>
The	O
relational	B-Application
calculus	I-Application
is	O
similar	O
to	O
the	O
relational	B-Algorithm
algebra	I-Algorithm
,	O
which	O
is	O
also	O
part	O
of	O
the	O
relational	B-Architecture
model	I-Architecture
:	O
While	O
the	O
relational	B-Application
calculus	I-Application
is	O
meant	O
as	O
a	O
declarative	O
language	O
which	O
prescribes	O
no	O
execution	O
order	O
on	O
the	O
subexpressions	O
of	O
a	O
relational	B-Application
calculus	I-Application
expression	O
,	O
the	O
relational	B-Algorithm
algebra	I-Algorithm
is	O
meant	O
as	O
an	O
imperative	O
language	O
:	O
the	O
sub-expressions	O
of	O
a	O
relational	O
algebraic	O
expression	O
are	O
meant	O
to	O
be	O
executed	O
from	O
left-to-right	O
and	O
inside-out	O
following	O
their	O
nesting	O
.	O
</s>
<s>
Per	O
Codd	B-Application
's	I-Application
theorem	I-Application
,	O
the	O
relational	B-Algorithm
algebra	I-Algorithm
and	O
the	O
domain-independent	B-Application
relational	B-Application
calculus	I-Application
are	O
logically	O
equivalent	O
.	O
</s>
<s>
A	O
relational	B-Algorithm
algebra	I-Algorithm
expression	O
might	O
prescribe	O
the	O
following	O
steps	O
to	O
retrieve	O
the	O
phone	O
numbers	O
and	O
names	O
of	O
book	O
stores	O
that	O
supply	O
Some	O
Sample	O
Book	O
:	O
</s>
<s>
A	O
relational	B-Application
calculus	I-Application
expression	O
would	O
formulate	O
this	O
query	O
in	O
the	O
following	O
descriptive	O
or	O
declarative	O
manner	O
:	O
</s>
<s>
The	O
relational	B-Algorithm
algebra	I-Algorithm
and	O
the	O
domain-independent	B-Application
relational	B-Application
calculus	I-Application
are	O
logically	O
equivalent	O
:	O
for	O
any	O
algebraic	O
expression	O
,	O
there	O
is	O
an	O
equivalent	O
expression	O
in	O
the	O
calculus	O
,	O
and	O
vice	O
versa	O
.	O
</s>
<s>
This	O
result	O
is	O
known	O
as	O
Codd	B-Application
's	I-Application
theorem	I-Application
.	O
</s>
<s>
The	O
raison	O
d'être	O
of	O
the	O
relational	B-Application
calculus	I-Application
is	O
the	O
formalization	O
of	O
query	B-Language
optimization	I-Language
.	O
</s>
<s>
Query	B-Language
optimization	I-Language
consists	O
in	O
determining	O
from	O
a	O
query	O
the	O
most	O
efficient	O
manner	O
(	O
or	O
manners	O
)	O
to	O
execute	O
it	O
.	O
</s>
<s>
Query	B-Language
optimization	I-Language
can	O
be	O
formalized	O
as	O
translating	O
a	O
relational	B-Application
calculus	I-Application
expression	O
delivering	O
an	O
answer	O
A	O
into	O
efficient	O
relational	O
algebraic	O
expressions	O
delivering	O
the	O
same	O
answer	O
A	O
.	O
</s>
