Tuple Relational Calculus (TRC) MCQs: 12 Solved Questions on Queries, Quantifiers and Safety

Practise 12 TRC questions with worked explanations, concrete tuple traces, implication checks, division, query interpretation and safety conventions.

KnowledgeGate Team

Exam prep & CS education

25 Oct 20268 min read

Tuple Relational Calculus questions mix declarative query reading, predicate logic, relational-algebra equivalence and safety, so memorising {t | P(t)} is not enough. You must read each binding, follow the quantifiers, distinguish logical notation from algebra operators and test whether the result stays inside a finite domain.

These 12 questions come from GATE, UGC NET, UP LT Grade and NIACL AO IT Specialist papers. Attempt each one before opening the explanation, note every variable's range, and use the heading link for the full question page.

Tuple Relational Calculus basics and declarative query form

TRC describes the property a result tuple must satisfy, while relational algebra specifies operators. The SQL Queries and Joins in DBMS guide connects logical intent to executable queries.

Question 1: NIACL AO IT Specialist 2020

Tuple Relational Calculus query is expressed as ______.

  • A. { T | p(T) }

  • B. { P() | T }

  • C. { p(T) | T }

  • D. { T | P() | T }

Answer: A. { T | p(T) }. T is the result tuple and p(T) its predicate. The bar means “such that,” so the expression returns every T satisfying p(T).

Question 2: UGC NET 2018

Which one is correct? (a) DML includes a query language based on both relation algebra and tuple calculus (b) DML includes a query language based on tuple calculus (c) DML includes a query language based on relational algebra (d) DML includes a query language based on none of the relational algebra and tuple calculus

  • A. a

  • B. b

  • C. c

  • D. d

Answer: A. a. Relational algebra gives an operator view; tuple calculus gives a declarative view. Their safe forms express the same relational queries.

Predicates, implication and quantifiers in TRC

Remember: implication has one false case, exists needs one witness, and forall tests every permitted tuple.

Question 3: UP LT Grade 2022

In tuple relational calculus P₁ → P₂ is equivalent to –

  • A. ¬P₁ ∨ P₂

  • B. P₁ ∨ P₂

  • C. P₁ ∧ P₂

  • D. P₁ ∧ ¬P₂

Answer: A. ¬P₁ ∨ P₂. Both expressions give (T,T)->T, (T,F)->F, (F,T)->T, (F,F)->T. The expression P₁ ∧ ¬P₂ identifies only the false case.

Question 4: NIACL AO IT Specialist 2024

In TRC, which of the following mathematical notations is used as a quantifier to express that at least one tuple in the relation satisfies a specific condition?

  • A. ∀

  • B. ∃

  • C. σ

  • D. π

  • E. ∪

Answer: B. ∃. In Employee = {(Asha, 48000), (Bharat, 50000), (Charu, 50001)}, Charu witnesses exists t in Employee (t.salary > 50000). forall fails for Asha and Bharat; σ, π and ∪ are algebra operators.

Translating selection conditions and recognising TRC boundaries

{t | Employee(t) AND condition} is TRC; sigma_condition(Employee) is relational algebra.

Question 5: NIACL AO IT Specialist 2024

In TRC (Tuple Relational Calculus), which of the following expressions correctly retrieves all tuples from the Employee relation where the attribute salary is strictly greater than 50,000?

  • A. {t | Employee(t) ∨ t.salary > 50000}

  • B. σ salary>50000(Employee)

  • C. {t : salary > 50000 || Employee(t)}

  • D. {t | Employee(t) → t.salary > 50000}

  • E. {t | Employee(t) ∧ t.salary > 50000}

Answer: E. {t | Employee(t) ∧ t.salary > 50000}. In Employee = {(Asha,48000), (Bharat,50000), (Charu,50001), (Dev,72000)}, only Charu and Dev pass, giving {(Charu,50001), (Dev,72000)}. Bharat fails the strict boundary; A admits outsiders, B is algebra, and D does not enforce membership.

Question 6: NIACL AO IT Specialist 2025

Which operation cannot be directly performed using Tuple Relational Calculus, compared to operations on relational tables?

  • A. Projection

  • B. Selection

  • C. Join

  • D. Aggregation

  • E. Cartesian Product

Answer: D. Aggregation. Safe TRC expresses selection, projection, products and joins through predicates. Classical TRC has no direct aggregate operators such as COUNT or SUM.

TRC and relational-algebra equivalence questions

Compare safe TRC and relational algebra by their result relations, not their notation.

Question 7: GATE 1999

The relational algebra expression equivalent to the following tuple calculus expression is: { t | t ∈ r ∧ (t[A] = 10 ∧ t[B] = 20) }

  • A. σ(A=10 ∨ B=20)(r)

  • B. σ(A=10)(r) ∪ σ(B=20)(r)

  • C. σ(A=10)(r) ∩ σ(B=20)(r)

  • D. σ(A=10)(r) - σ(B=20)(r)

Answer: C. σ(A=10)(r) ∩ σ(B=20)(r). For r = {(10,20), (10,30), (7,20)}, A=10 gives the first two tuples; B=20 gives the first and third. Their intersection is {(10,20)}. AND maps to intersection, while OR maps to union.

Question 8: GATE 2009

Code
Let R and S be relational schemes such that R={a,b,c} and S={c}. Now consider the following queries on the database:

I. π(R-S)(r) - π(R-S)(π(R-S)(r) × s - π(R-S,S)(r))

II. {t | t ∈ π(R-S)(r) ∧ ∀u ∈ s (∃v ∈ r (u = v[S] ∧ t = v[R-S]))}

III. {t | t ∈ π(R-S)(r) ∧ ∀v ∈ r (∃u ∈ s (u = v[S] ∧ t = v[R-S]))}

IV) SELECT R.a, R.b
       FROM R,S
            WHERE R.c=S.c

Which of the above queries are equivalent?
  • A. I and II

  • B. I and III

  • C. II and IV

  • D. III and IV

Answer: A. I and II. For R(a,b,c) = {(1,x,10), (1,x,20), (2,y,10)} and S(c) = {10,20}, only (1,x) matches every S value. I constructs division; II states it with quantifiers. III reverses the dependency, while IV is a join-projection with SQL bag semantics.

Reading what a TRC query actually returns

Identify the result, bind every variable, then expand or negate the predicate.

Question 9: GATE 2007

Consider the relation employee(name, sex, supervisorName) with name as the key. supervisorName gives the name of the supervisor of the employee under consideration. What does the following Tuple Relational Calculus query produce?

Code
{e.name | employee(e) ∧ (∀x)[¬employee(x) ∨ x.supervisorName ≠ e.name ∨ x.sex = "male"] }
  • A. Names of employees with a male supervisor.

  • B. Names of employees with no immediate male subordinates.

  • C. Names of employees with no immediate female subordinates.

  • D. Names of employees with a female supervisor.

Answer: C. Names of employees with no immediate female subordinates. The clause rejects an e with a supervised x who is not male. In employee = {(Anita,female,Rahul), (Bela,female,Rahul), (Chetan,male,Rahul), (Deepak,male,Nisha)}, Rahul would fail and Nisha pass if both had employee tuples. With exactly four rows, neither can be e, so all four named employees pass.

Question 10: GATE 2008

Code
Consider the following relational schema:

Student(school-id, sch-roll-no, sname, saddress)
School(school-id, sch-name, sch-address, sch-phone)
Enrolment(school-id, sch-roll-no, erollno, examname)
ExamResult(erollno, examname, marks)

Consider the following tuple relational calculus query:

{t | exists E in Enrolment
  t = E.school-id AND
  |{x | x in Enrolment AND x.school-id = t AND
    (exists B in ExamResult
      B.erollno = x.erollno AND
      B.examname = x.examname AND
      B.marks > 35)}|
  / |{x | x in Enrolment AND x.school-id = t}| * 100 > 35}

If a student needs more than 35 marks to pass an exam, what does the query return?
  • A. The empty set

  • B. Schools with more than 35% of its students enrolled in some exam or the other

  • C. Schools with a pass percentage above 35% over all exams taken together

  • D. Schools with a pass percentage above 35% over each exam.

Answer: C. Schools with a pass percentage above 35% over all exams taken together. The numerator counts passing ExamResult rows for one school, while the denominator counts its Enrolment rows; there is no grouping by examname. If S1 has 8 Maths passes from 10 attempts and 1 Science pass from 10 attempts, its overall rate is 9/20 * 100 = 45%, so C includes it. D would require each exam to exceed 35%, and Science is only 10%.

Safe and unsafe Tuple Relational Calculus expressions

A safe query is domain-independent and range-restricted to a finite active domain. The earlier Safety of Expressions and Power MCQs owns the active-domain and expressive-power drill; this mixed TRC set uses one GATE 2001 safety item as a checkpoint after notation, translation and result reading.

Question 11: GATE 2001

Which of the tuple relational calculus expression is NOT safe?

  • A. { t | ∃u ∈ R1 ( t[A] = u[A] ) ∧ ¬∃s ∈ R2 ( t[A] = s[A] ) }

  • B. { t | ∀u ∈ R1 ( u[A] = "x" ⇒ ∃s ∈ R2 ( t[A] = s[A] ∧ s[A] = u[A] ) ) }

  • C. { t | ¬( t ∈ R1 ) }

  • D. { t | ∃u ∈ R1 ( t[A] = u[A] ) ∧ ∃s ∈ R2 ( t[A] = s[A] ) }

Answer: C. { t | NOT (t in R1) }. C takes the unrestricted complement of R1, so values outside the active domain can enter the result. A and D bind t[A] to stored values. The GATE key treats C as the expression that is unsafe for every database instance; B also exposes a strict domain-independence caveat when no R1 tuple has A = "x" and its implication becomes vacuously true.

Question 12: GATE 2017

Consider a database that has the relation schemas EMP(EmpId, EmpName, DeptId), and DEPT(DeptName, DeptId). Note that the DeptId can be permitted to be NULL in the relation EMP. Consider the following queries on the database expressed in tuple relational calculus. I. {t | ∃u ∈ EMP(t[EmpName] = u[EmpName] ∧ ∀v ∈ DEPT(t[DeptId] ≠ v[DeptId]))} II. {t | ∃u ∈ EMP(t[EmpName] = u[EmpName] ∧ ∃v ∈ DEPT(t[DeptId] ≠ v[DeptId]))} III. {t | ∃u ∈ EMP(t[EmpName] = u[EmpName] ∧ ∃v ∈ DEPT(t[DeptId] = v[DeptId]))} Which of the above queries are safe?

  • A. I and II only

  • B. I and III only

  • C. II and III only

  • D. I, II and III

Answer: D. I, II and III, by the GATE 2017 key. The key's syntactic convention treats comparisons between t[DeptId] and a DEPT-bound v as range-restricting, so all three count as safe. Under strict domain independence, only III is airtight because equality ties t[DeptId] to a stored value; inequality in I and II can admit outside values. Since 'III only' is absent, use D for this PYQ and remember the convention clash.

How TRC MCQs are tested and the next practice step

Notation and logic appear in Q1 to Q4, translation in Q5 to Q8, interpretation in Q9 and Q10, and safety in Q11 and Q12. If the last four caused trouble, bind every variable and trace a relation.

Use the SQL Query MCQs for translation. The GATE CS exam preparation category gives the wider route.

The short version

Redo wrong answers after 48 hours, writing each variable beside its quantifier. For the full DBMS sequence, continue with GATE Guidance by Sanchit Sir.