What is TRC and DRC in DBMS?

11.6k views Asked by At

What is tuple relational calculus (TRC) and domain relational calculus (DRC)? How do they differ with relational algebra?

I am new in DBMS field. But I have learned basics of relational algebra.

3

There are 3 answers

0
reaanb On BEST ANSWER
  • In relational algebra, variables contain relations and operators derive relations by transforming or combining relations.
  • Relational calculii use set builder notation and logical connectives to define a new relation by describing the tuples and attributes that make it up.
  • In tuple relational calculus, variables denote tuples and attributes are referred by name.
  • In domain relational calculus, variables denote attributes and tuples are constructed via a positional notation.
1
ChiranjeeviIT On

Relational algebra is procedural language and Tuple relational calculas is non-procedural language. In Tuple relational language we use notations to request the data.

Although relational algebra is useful in the analysis of query evaluation, SQL is actually based on a different query language. Relational calculus useful to define the semantics of the relational algebra and SQL

Below is the example(Link between TRC and SQL):

TRC = {T | Teaching(T) AND T.Semester = ‘F2000’}
SQL = SELECT *
      FROM Teaching T
      WHERE T.Semester = ‘F2000’

Target T corresponds to SELECT list: the query result contains the entire tuple. Body split between two clauses:

  • Teaching(T) corresponds to FROM clause
  • T.Semester = ‘F2000’ corresponds to WHERE clause

well in the above answer I would like to add the following line : The statement above = TRC = {T | Teaching(T) AND T.Semester = ‘F2000’}

can be reffered as "T is a variable(tuple) whose value is equal to Teaching(T) and T.Semester = ‘F2000’ simultaneously" ie. T is the tuple from relation "Teaching" and reffers to tuples having attribute "Semester" as ‘F2000’ .

0
rudatinya ephrem On

Domain Relational Calculus - In contrast to tuple relational calculus, domain relational calculus uses a list of attribute to be selected from the relation based on the condition. It is same as TRC, but differs by selecting the attributes rather than selecting whole tuples.

Tuple Relational Calculus - A tuple relational calculus is a non procedural query language which specifies to select the tuples in a relation. It can select the tuples with range of values or tuples for certain attribute values etc. The resulting relation can have one or more tuples.