What is the exact difference between relational algebra and relational calculus. At most of the reference, it will be
Relational algebra is procedural and cal
Difference between the Relational algebra and the Relational Calculus
Relational algebra operations manipulate some relations and provide some expression in the form of queries where as relational calculus are formed queries on the basis of pairs of expressions.
RA have operator like join, union, intersection, division, difference, projection, selection etc. where as RC has tuples and domain oriented expressions.
RA is procedural language where as RC is non procedural query system.
Expressive power of RA and RC are equivalent. This means any query that could be expressed in RA could be expressed by formula in RC.
Any KC formula is translated in Algebric query.
There is modification which is easy in queries in RA than the RC.
RA formed the mathematical form and have no specificjuer1 language RC also has mathematical form but has one query language QUEL.
Relational algebra is easy to manipulate and understand than RC.
RA queries are more powerful than the RC.
RC are formed WFFs where as RA does not form any formula.
RA is a procedural. That means we have write some conditions in order.
RC is a Non procedural. In here we have write the conditions in any order.
Example:-
Library Example:-
Book is a relation it have a following attributes.
1. Book Name
2. Accession Number
3. Year of publication
Problem:-
Find out the all book names published in the year 2000
Relational Algebra:-
-------------------------------------------------------
| (σ (book) ) |
| ¶ (yr_pub=2000) |
| (Book name) |
------------------------------------------------------
Relational calculus:-
S = { t | ∃ u ∈ book (t[book name] = u[book name]) ∧ (u[yr_pub] = 2000 ) }
In this relational calculus we can write the condition in any where like the below.
S = { t | ∃ u ∈ book (u[yr_pub] = 2000 ) ∧ (t[book name] = u[book name]) }
But in relational algebra, we have to find first what are the tuples have the year of publication is 2000, then only we have to extract the book name column.