Skip to content
Related Articles

Related Articles

Difference between Tuple Relational Calculus (TRC) and Domain Relational Calculus (DRC)

Improve Article
Save Article
  • Difficulty Level : Easy
  • Last Updated : 07 Jun, 2022
Improve Article
Save Article

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

Notation :
{T | P (T)}   or {T | Condition (T)}  

where T is the resulting tuples and P(T) is a condition used to fetch T. 

Example : 

{T | EMPLOYEE (T) AND T.DEPT_ID = 10} 

This selects all the tuples of employee names who work for Department 10. 

2. Domain Relational Calculus (DRC) : 
A domain relational calculus uses the list of attributes to be selected from the relation based on the condition. It is the same as TRC but differs by selecting the attributes rather than selecting whole tuples.  

Notation :
{ a1, a2, a3, ..., an | P (a1, a2, a3, ..., an) } 

Where a1, a2, a3, … an are attributes of the relation and P is the condition. 

Example : 

{ |  < EMPLOYEE > DEPT_ID = 10 } 

select EMP_ID and EMP_NAME of employees who work for department 10. 

Difference between Tuple Relational Calculus (TRC) and Domain Relational Calculus (DRC) : 

S. No.Basis of ComparisonTuple Relational Calculus (TRC)Domain Relational Calculus (DRC)
1.DefinitionThe Tuple Relational Calculus (TRC) is used to select tuples from a relation. The tuples with specific range values, tuples with certain attribute values, and so on can be selected.The Domain Relational Calculus (DRC) employs a list of attributes from which to choose based on the condition. It’s similar to TRC, but instead of selecting entire tuples, it selects attributes.
2.Representation of variablesIn TRC, the variables represent the tuples from specified relations.In DRC, the variables represent the value drawn from a specified domain.
3.Tuple/ DomainA tuple is a single element of relation. In database terms, it is a row.A domain is equivalent to column data type and any constraints on the value of data.
4.FilteringThis filtering variable uses a tuple of relations.This filtering is done based on the domain of attributes.
5.Return ValueThe predicate expression condition associated with the TRC is used to test every row using a tuple variable and return those tuples that met the condition.DRC takes advantage of domain variables and, based on the condition set, returns the required attribute or column that satisfies the criteria of the condition.
5.Membership conditionThe query cannot be expressed using a membership condition.The query can be expressed using a membership condition.
6.Query LanguageThe QUEL or Query Language is a query language related to it, The QBE or Query-By-Example is query language related to it.
7.SimilarityIt reflects traditional pre-relational file structures. It is more similar to logic as a modeling language.
8.SyntaxNotation:  {T | P (T)} or {T | Condition (T)}Notation: { a1, a2, a3, …, an | P (a1, a2, a3, …, an)}
9.Example{T | EMPLOYEE (T) AND T.DEPT_ID = 10}{ | < EMPLOYEE > DEPT_ID = 10 }
My Personal Notes arrow_drop_up
Related Articles

Start Your Coding Journey Now!