 Welcome back MechanicalEI. Did you know that relational algebra provides a theoretical foundation for query languages in relational databases? This makes us wonder, what is relational algebra? Before we jump in, check out the previous part of this series to learn about what the advantages of a relational model are. Now, relational algebra is a procedural query language which takes instances of relations as input and yields instances of relations as output. It uses operators to perform relational algebra queries. An operator can be either unary or binary. There are six fundamental relational algebra operations. First is a select operation which selects tuples that satisfy the given predicate from a relation. Second comes the project operation which projects columns that satisfy a given predicate. Third is the union operation which performs binary union between two given relations. Fourth is the set different operation. The result of set difference query is tuples which are present in one relation but are not in the second relation. Fifth comes the cartation product operation which combines information of two different relations into one. Sixth and last is the rename operation and it allows us to rename the output relation. In contrast to relational algebra, relational calculus is a non-procedural query language. That is, it tells us what to do but never explains how to do it. Relational calculus exists in two forms. First is tuple relational calculus. In TRC, the filtering variable ranges over tuples. It has the following notation which returns all tuples t that satisfy the condition. Second comes domain relational calculus or DRC. In DRC, the filtering variable uses the domain of attributes instead of entire tuple values. It has this notation where A1, A2 are attributes and P stands for formulae built by inner attributes. Hence, we first saw what relational algebra and its operators are and then went on to see what relational calculus is. In the next episode of Mechanical EI, find out what SQL is.