Relational Algebra Tutorial

Database | Home | Next page











 


Introduction to Relational Algebra

*Before going on, this tutorial assumes you already have a basic understanding of the structure of relational databases.

Relational algebra is a procedural query language, which consists of a set of operations that take one or two relations as input and produce a new relation as their result. The fundamental operations that will be discussed in this tutorial are: select, project, union, and set difference. Besides the fundamental operations, the following additional operations will be discussed: set-intersection.

Each operation will be applied to tables of a sample database. Each table is otherwise known as a relation and each row within the table is refered to as a tuple. The sample database consists of tables in which one might see in a bank. The sample database consists of the following 6 relations:

The account relation

branch-name
account-number
balance
Downtown
Mianus
Perryridge
Round Hill
Brighton
Redwood
Brighton
A-101
A-215
A-102
A-305
A-201
A-222
A-217
500
700
400
350
900
700
750

 

Database | Home | Top of page | Next page