Tuple relational calculus is an alternative to relational algebra for describing the structure of tuples, or records, within a database. Tuple relational calculus is extremely influential in and provides the logical backing for commercial query languages such as SQL and QBE.

Tuple relational calculus revolves around the concept of a tuple variable, which is a variable that takes on tuples (records) of a particular relation schema as values. In other words, much as variables represent numerical values in classical algebra, variables in tuple relational calculus each represent a particular number of fields, each with a unique type, that are capable of storing data.

A tuple relational calculus query has the form { T | p(T) }, where T is a tuple variable and p(T) is a formula that describes T. The result of this query is a set of tuples (again, tuples are essentially database records) t where the formula p(T) is true with T = t. In other words, a query narrows down T to a smaller subset.

Let's look at an example:

Query: Find all employees with a MCSE rating above 85.
Translated Query: { S | S -> Employees ^ E.MCSErating > 85 }

The above example is just a simple example of tuple relational calculus. It provides a simple, symbolic language with which one can symbolically express any data query.

Tuple relational calculus theory overlaps heavily with set theory, utilizing much of the same logic (OR, NOR, XOR, AND, etc.) in a similar logical and symbolic notation. Due to this overlap, much of set theory can be applied directly to database queries. In fact, there is so much common theory between the two that many people consider tuple relational calculus to be a subfield of set theory applied to databases.

The ability to discretely express queries provides the ability to break down queries into very small subproblems. The smallness of these subproblems (optimal solutions to OR, AND, etc.) and their strong usefulness in a number of computer science fields has resulted in these problems having very quick solutions. Applying this research to queries, thus making databases very quick to search, makes tuple relational calculus theory very useful to every one of us on a daily basis when we access online accounts, play games, or even search e2.

Log in or register to write something here or to contact authors.