In this guide, we will discuss what is Relational algebra and relational calculus and why we use these concepts. In the previous tutorials, we discussed the designing of database using Relational model, E-R diagram and normalization. Now that we have designed the database, we need to store and retrieve data from the database, for this purpose we need to understand the concept of Relational algebra and relational calculus.
Let’s start with the basics.
In simple words, a Language which is used to store and retrieve data from database is known as query language. For example – SQL
There are two types of query language:
1.Procedural Query language
2.Non-procedural query language
1. Procedural Query language:
In procedural query language, user instructs the system to perform a series of operations to produce the desired results. Here users tells what data to be retrieved from database and how to retrieve it.
For example – Let’s take a real world example to understand the procedural language, you are asking your younger brother to make a cup of tea, if you are just telling him to make a tea and not telling the process then it is a non-procedural language, however if you are telling the step by step process like switch on the stove, boil the water, add milk etc. then it is a procedural language.
2. Non-procedural query language:
In Non-procedural query language, user instructs the system to produce the desired result without telling the step by step process. Here users tells what data to be retrieved from database but doesn’t tell how to retrieve it.
Now let’s back to our main topic of relational algebra and relational calculus.
Relational algebra is a conceptual procedural query language used on relational model.
Relational calculus is a conceptual non-procedural query language used on relational model.
I have used word conceptual while describing relational algebra and relational calculus, because they are theoretical mathematical system or query language, they are not the practical implementation, SQL is a practical implementation of relational algebra and relational calculus.
Relational Algebra, Calculus, RDBMS & SQL:
Relational algebra and calculus are the theoretical concepts used on relational model.
RDBMS is a practical implementation of relational model.
SQL is a practical implementation of relational algebra and calculus.
In the next tutorials we will cover the relational algebra and calculus in detail.