codingstuff.io
ExploreTutorialsProblemsCS Subjects
Get Started
ExploreTutorialsProblemsCS Subjects
Get Started
codingstuff.io

Master the art of building software through interactive tutorials, real-world problems, and guided projects.

Pune, Maharashtra, India

codingstuffmail@gmail.com

Product

  • Explore
  • Tutorials
  • Problems
  • CS Subjects

Company

  • About
  • Contact
  • Privacy Policy
  • Terms & Conditions
  • Sitemap

© 2026 codingstuff.io. All rights reserved.

Built with ❤️ for developers everywhere

/
/
All Subjects
🗄️

DBMS

23 chapters

1Intro & 3-Schema Architecture2ER Model & Diagrams3Generalization, Specialization & Aggregation4Relational Model & Codd's Rules5Relational Algebra6Tuple & Domain Relational Calculus7SQL: DDL, DML, DCL8Advanced SQL (Joins, Aggregates)9Views, Triggers & Stored Procedures10Functional Dependencies11Normalization (1NF, 2NF, 3NF)12BCNF & Lossless Decomposition13Transaction Concepts & ACID14Conflict & View Serializability15Concurrency Control & Locks162-Phase Locking (2PL)17Timestamp-Based Protocols18Indexing (Primary, Clustering)19B-Trees & B+ Trees20Hashing Techniques in DBMS21Database Recovery Techniques22NoSQL Databases Overview23Data Warehousing Concepts
SubjectsDBMS

Tuple & Domain Relational Calculus

Updated 2026-05-03
2 min read

Tuple & Domain Relational Calculus

While Relational Algebra is a procedural language (you specify the sequence of operations), Relational Calculus is a non-procedural (declarative) language. You describe WHAT you want, not HOW to get it. SQL is based heavily on Relational Calculus.

1. Tuple Relational Calculus (TRC)

In TRC, queries are of the form: {t | P(t)} — "the set of all tuples $t$ such that predicate $P(t)$ is true."

Example: Find all employees with salary greater than 50000: {t | t ∈ Employee ∧ t.salary > 50000}

Example with quantifiers: Find names of employees who work in the 'CS' department: {t.name | t ∈ Employee ∧ ∃d ∈ Department (t.dept_id = d.id ∧ d.name = 'CS')}

2. Domain Relational Calculus (DRC)

In DRC, variables represent individual attribute values (domain values) rather than entire tuples.

Queries are of the form: {x_1, x_2, ..., x_n | P(x_1, x_2, ..., x_n)}

Example: Find the name and salary of employees in department 5: {n, s | ∃i (Employee(i, n, s, 5))}

3. Safe Expressions

A relational calculus expression is safe if it guarantees a finite number of results. The expression {t | ¬(t ∈ Employee)} is unsafe because it returns all possible tuples that are NOT in the Employee table—an infinite set!

4. Equivalence

Relational Algebra, Tuple Relational Calculus, and Domain Relational Calculus are all relationally complete — they have the same expressive power. Any query that can be expressed in one can be expressed in the others. SQL is relationally complete.



PreviousRelational AlgebraNextSQL: DDL, DML, DCL

Recommended Gear

Relational AlgebraSQL: DDL, DML, DCL