Tuple Relational Calculus
Filtering variable ranges over tuples.
Notation − {T | Condition}
Returns all tuples T that satisfies a condition.
For example −
{ T.name | Author(T) AND T.article = 'database' }
Output − Returns tuples with ‘name’ from Author who has written article on ‘database’.
Domain Relational Calculus (DRC)
In DRC, the filtering variable uses the domain of attributes instead of entire tuple values (as done in TRC, mentioned above).
Notation −
{ a1, a2, a3, ..., an | P (a1, a2, a3, ... ,an)}
Where a1, a2 are attributes and P stands for formulae built by inner attributes.
For example − {< article, page, subject > | ∈ Sahoo ∧ subject = 'database'}
Output − Yields Article, Page, and Subject from the relation Sahoo, where subject is database.