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

Last Updated : 22 Mar, 2023

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.

Previous
Next