How Relational Calculus is different from Relational Algebra? What do understand by TRC queries and DRC queries?
Ans: Relational calculus contain two calculi, the tuple relational calculus and the domain relational calculus which are part of the relational model for databases and offer a declarative way to specify database queries. This in deference to the relational algebra that is also part of the relational model but offers a more procedural way for specifying queries.
The relational algebra might propose these steps to retrieve the phone numbers and names of book stores which supply Some Sample Book:
a. Join books and titles over the BookstoreID.
b. Restrict the result of that join to tuples for the book a few Sample Book.
c. Project the result of that restriction over StoreName and StorePhone.
The relational calculus would formulate an expressive, declarative way:
Get StoreName and StorePhone for supplies like there exists a title BK with the
same BookstoreID value and along with a BookTitle value of a few Sample Book.
The relational algebra and the relational calculus are fundamentally logically equivalent: for any algebraic expression, there is an equal expression in the calculus, and vice versa. This result is termed as Codd's theorem.
TRC illustrates the tuple relational calculus and DRC stands for domain relational calculus. The TRC is relies on specifying a query in terms of tuple variable and DRC is relies on domain variables.