Relational algebra, Relational calculus, and Tuple and Domain calculus
Relational algebra and calculus are two mathematical query languages used to manipulate data in a relational database. Tuple and domain calculus are two variations of the relational calculus.
Relational algebra: This is a procedural query language that uses a set of operations to retrieve data from a relational database. The operations in relational algebra include selection, projection, union, intersection, difference, join, and division.
Relational calculus: This is a non-procedural query language that specifies what data to retrieve from a relational database, but not how to retrieve it. There are two types of relational calculus: tuple calculus and domain calculus.
Tuple calculus: This type of relational calculus is used to retrieve data by specifying a set of conditions that must be met by the tuples in a relation.
Domain calculus: This type of relational calculus is used to retrieve data by specifying a set of conditions that must be met by the values in a relation.
Both relational algebra and calculus are used to express complex queries in a relational database. Relational algebra provides a set of operations that can be combined to express complex queries, while relational calculus provides a declarative language to specify what data to retrieve. Tuple and domain calculus are variations of relational calculus that provide more precise control over the selection of tuples or values in a relation.