Relational Calculus MCQs for Gate Exam

Relational Calculus MCQs (Q1–Q100)


Q1.

Consider relation Student(SID, Name, Age, Marks).
Which of the following Tuple Relational Calculus (TRC) expressions retrieves names of students with Marks > 80?
A. {t | ∃s ∈ Student (t.Name = s.Name ∧ s.Marks > 80)}
B. {t | ∀s ∈ Student (t.Marks > 80)}
C. {t | ∃s ∈ Student (s.Marks = 80)}
D. {t | t.Marks > 80}
Answer: A
💡 Solution:
t represents result tuples; expression uses existential quantifier correctly and binds s to relation.


Q2.

In TRC, which quantifier ensures universal condition?
A. ∃
B. ∀
C. ¬∃
D. =
Answer: B
💡 Solution:
(for all) ensures every tuple satisfies the condition — used for universal quantification.


Q3.

Find names of students who are older than all students named ‘Riya’.
A. {t | ∃s ∈ Student (t.Age > s.Age ∧ s.Name=’Riya’)}
B. {t | ∀s ∈ Student (s.Name=’Riya’ ⇒ t.Age > s.Age)}
C. {t | ¬∃s ∈ Student (s.Name=’Riya’ ∧ t.Age ≤ s.Age)}
D. Both B and C
Answer: D
💡 Solution:
Both (B) universal and (C) negated existential forms are logically equivalent in relational calculus.


Q4.

If a TRC expression contains both and , it represents:
A. Procedural Query
B. Declarative Query
C. Imperative Program
D. SQL Stored Function
Answer: B
💡 Solution:
Relational calculus is non-procedural (declarative) — specifies what to retrieve, not how.


Q5.

Given Employee(EID, Dept, Salary) find employees whose salary is greater than some employee in Dept ‘HR’.
A. {t | ∃e ∈ Employee (e.Dept=’HR’ ∧ t.Salary > e.Salary)}
B. {t | ∀e ∈ Employee (e.Dept=’HR’ ∧ t.Salary > e.Salary)}
C. {t | t.Salary > ALL(SELECT Salary FROM Employee WHERE Dept=’HR’)}
D. {t | ¬∃e ∈ Employee (e.Dept=’HR’)}
Answer: A
💡 Solution:
The existential quantifier “some” maps to , checking existence of a lower-salary HR employee.


Q6.

In Domain Relational Calculus (DRC), which is a valid query form?
A. { | P(x,y)}
B. {x,y | P(x,y)}
C. {t | t ∈ R}
D. {tuple | tuple ⊆ R}
Answer: A
💡 Solution:
DRC expresses results as lists of attribute values, not tuple variables.


Q7.

Find all roll numbers r such that student scored more than 70 marks:
A. {r | ∃n,m (Student(r,n,m) ∧ m > 70)}
B. {r | ∀n,m (Student(r,n,m) ⇒ m > 70)}
C. {r | Student(r,n,70)}
D. {r | ∃m (m < 70)}
Answer: A
💡 Solution:
Uses domain variables (r,n,m) and existential quantifier correctly.


Q8.

Which of the following statements is true about relational calculus?
A. It specifies how to retrieve data.
B. It is equivalent in expressive power to relational algebra.
C. It can express non-relational operations.
D. It cannot represent negation.
Answer: B
💡 Solution:
Codd’s theorem: Relational algebra ≡ Relational calculus in expressive power.


Q9.

A safe TRC expression ensures:
A. Finite result set
B. Infinite result set
C. Referential independence
D. Nested quantification
Answer: A
💡 Solution:
Safety rule restricts domain of variables ⇒ only finite tuples are returned.


Q10.

Which is an unsafe TRC query?
A. {t | t ∈ Student ∧ t.Marks > 70}
B. {t | ¬(t ∈ Student)}
C. {t | ∃s ∈ Student (s.Marks = t.Marks)}
D. {t | t.Marks = 90}
Answer: B
💡 Solution:
¬(t ∈ Student) defines infinite domain — unsafe.


Q11.

The domain of a variable in relational calculus refers to:
A. The type of variable
B. The set of all possible values
C. Tuple schema
D. Query result
Answer: B
💡 Solution:
Domain = all possible attribute values a variable may take.


Q12.

Find all employee IDs who earn the highest salary:
A. {t | t ∈ Emp ∧ ¬∃e ∈ Emp (e.Salary > t.Salary)}
B. {t | ∃e ∈ Emp (e.Salary < t.Salary)}
C. {t | t ∈ Emp ∧ t.Salary < ALL(Emp.Salary)}
D. None
Answer: A
💡 Solution:
Negated existence ensures no higher salary exists — retrieves max-salary tuples.


Q13.

Which relational calculus construct allows expressing joins?
A. Multiple tuple variables and conjunction (∧)
B. Union operator
C. Arithmetic comparison
D. Cartesian quantifier
Answer: A
💡 Solution:
Joining achieved using multiple tuple variables and conditions linking them.


Q14.

For R(A,B) and S(B,C), the TRC query {t | ∃r∈R, s∈S (r.B=s.B ∧ t.A=r.A ∧ t.C=s.C)} is equivalent to:
A. R ⋈ S
B. R × S
C. R − S
D. π(A,C)(R)
Answer: A
💡 Solution:
Join condition r.B=s.B merges R and S tuples.


Q15.

In TRC, {t | ∃r ∈ R (t.A=r.A ∧ r.B>50)} returns:
A. Tuples with A values from R where B>50
B. All tuples of R
C. None
D. Only B values
Answer: A
💡 Solution:
The result includes all tuples t with A taken from r satisfying predicate.


Q16.

Which of the following is not allowed in safe relational calculus?
A. Equality
B. Conjunction
C. Unrestricted variables
D. Projection
Answer: C
💡 Solution:
All free variables must be range-restricted for safety.


Q17.

DRC and TRC differ primarily in:
A. Result form — domain values vs tuple variables
B. Expressive power
C. Quantifier types
D. Usage of joins
Answer: A
💡 Solution:
TRC uses tuples, DRC uses individual domain variables.


Q18.

Which relational calculus query returns employees who don’t belong to Dept 20?
A. {t | t ∈ Emp ∧ ¬(t.Dept=20)}
B. {t | ∃e ∈ Emp (t.Dept≠20)}
C. {t | ∀e ∈ Emp (e.Dept=20)}
D. None
Answer: A
💡 Solution:
Negation inside predicate correctly filters Dept ≠ 20.


Q19.

A bounded variable in TRC means:
A. It has finite possible values
B. It is bound by a quantifier
C. It is constant
D. It has no quantifier
Answer: B
💡 Solution:
Bound variable appears within scope of ∃ or ∀.


Q20.

An unbound variable represents:
A. Variable not used in condition
B. Output (free) variable of the query
C. Infinite domain variable
D. Aggregate function
Answer: B
💡 Solution:
Free variable (unbound) defines the attributes to appear in result.


Q21.

Which query retrieves tuples of R where no matching tuple in S exists (anti-join)?
A. {t | t∈R ∧ ¬∃s∈S (t.A=s.A)}
B. {t | ∃s∈S (t.A≠s.A)}
C. {t | t∈S}
D. {t | ∃t∈R}
Answer: A
💡 Solution:
Negated existential join ⇒ anti-join (R − R⋈S).


Q22.

For safe queries, the domain of result variables must be:
A. Finite
B. Infinite
C. Universal
D. None
Answer: A
💡 Solution:
Safety ensures finite computable result sets.


Q23.

In DRC, to express intersection, one uses:
A. ∧ (AND) operator
B. ∨ (OR) operator
C. ⇒
D. ¬
Answer: A
💡 Solution:
Intersection = tuples satisfying both predicates simultaneously.


Q24.

Which TRC expression finds names of students not enrolled in any course?
A. {t | t∈Student ∧ ¬∃e∈Enroll (e.SID=t.SID)}
B. {t | t∈Student ∧ ∃e∈Enroll (e.SID=t.SID)}
C. {t | ∀e∈Enroll (e.SID≠t.SID)}
D. Both A and C
Answer: D
💡 Solution:
Negated existence and universal quantification both represent “no enrollment”.


Q25.

Which of the following cannot be expressed in pure relational calculus?
A. Aggregation (SUM, AVG)
B. Selection
C. Projection
D. Join
Answer: A
💡 Solution:
Relational calculus lacks built-in aggregation operators — handled in extended forms only.

Q26.

Given relation Course(CID, CName, Credits), find course IDs having more than 3 credits.
A. {t | t ∈ Course ∧ t.Credits > 3}
B. {t | ∀c ∈ Course (t.Credits > 3)}
C. {t | ∃c ∈ Course (c.Credits < 3)}
D. {t | ¬(t.Credits ≤ 3)}
Answer: A
💡 Solution:
Direct tuple predicate with > operator filters courses; option B compares unrelated tuples.


Q27.

Which of the following TRC queries retrieves students enrolled in both “DBMS” and “OS” courses?
A. {t | ∃e1,e2 ∈ Enroll (e1.SID = e2.SID ∧ e1.Course=’DBMS’ ∧ e2.Course=’OS’ ∧ t.SID = e1.SID)}
B. {t | ∃e ∈ Enroll (e.Course IN {‘DBMS’,’OS’})}
C. {t | ∀e ∈ Enroll (e.Course=’DBMS’)}
D. {t | t.Course=’DBMS’ ∨ t.Course=’OS’}
Answer: A
💡 Solution:
Requires existence of two enrollments for the same SID; conjunction achieves intersection.


Q28.

Which TRC expression finds employees who earn less than everyone in Department 40?
A. {t | ∀e ∈ Emp (e.Dept=40 ⇒ t.Salary < e.Salary)}
B. {t | ∃e ∈ Emp (e.Dept=40 ∧ t.Salary < e.Salary)}
C. {t | t.Dept ≠ 40}
D. {t | ¬∃e ∈ Emp (e.Dept=40 ∧ t.Salary ≥ e.Salary)}
Answer: D
💡 Solution:
Negated existential and universal formulations are equivalent; D avoids unsafe universal scanning.


Q29.

In TRC, free variables correspond to:
A. Output attributes
B. Temporary variables
C. Quantified conditions only
D. Aggregates
Answer: A
💡 Solution:
Unbound (free) variables define the result schema.


Q30.

Which of the following TRC queries is unsafe?
A. {t | t∈Emp ∧ t.Salary > 50000}
B. {t | ¬∃e ∈ Emp (e.Salary = t.Salary)}
C. {t | t.Salary ≥ 0}
D. {t | t∈Emp ∧ t.Dept=’IT’}
Answer: C
💡 Solution:
t.Salary ≥ 0 has no range restriction—could generate infinite values.


Q31.

For safe queries, each free variable must appear:
A. Inside at least one atomic formula relating it to a relation
B. As a constant
C. Only once
D. After quantifier
Answer: A
💡 Solution:
Safety rule: every variable should be range-restricted by relation membership.


Q32.

Which TRC query is equivalent to π A (R)?
A. {t | ∃r ∈ R (t.A = r.A)}
B. {t | ∀r ∈ R (t.A = r.A)}
C. {t | ¬∃r ∈ R (t.A ≠ r.A)}
D. {t | t ∈ R ∧ r.A = 10}
Answer: A
💡 Solution:
Existential quantification captures projection by matching each A value in R.


Q33.

Given R(A,B) and S(B,C), the TRC query {t | ∃r∈R, s∈S (r.B=s.B ∧ t.A=r.A ∧ t.C=s.C)} corresponds to which algebraic operation?
A. Join
B. Cartesian product
C. Difference
D. Projection
Answer: A
💡 Solution:
The equality r.B = s.B implies a natural join on B.


Q34.

Which calculus query retrieves all tuples of R not in S (assuming both have attributes A,B)?
A. {t | t∈R ∧ ¬∃s∈S (t.A=s.A ∧ t.B=s.B)}
B. {t | ∃s∈S (t.A≠s.A)}
C. {t | t∈S}
D. {t | ¬(t∈R)}
Answer: A
💡 Solution:
Negated existential ensures tuples present in R only — represents R − S.


Q35.

Which calculus operation implements union?
A. Logical OR (∨)
B. Logical AND (∧)
C. Negation (¬)
D. Implication (⇒)
Answer: A
💡 Solution:
Union = tuples satisfying predicate P or Q.


Q36.

Find employees whose salary is not equal to any manager’s salary.
A. {t | t∈Emp ∧ ¬∃m∈Mgr (t.Salary = m.Salary)}
B. {t | t∈Emp ∧ ∀m∈Mgr (t.Salary = m.Salary)}
C. {t | t∈Emp ∧ m∈Mgr}
D. {t | t∈Mgr}
Answer: A
💡 Solution:
Negated existence excludes all salaries matching a manager’s.


Q37.

A tuple variable in TRC must always range over:
A. A relation in the database
B. Domain of constants
C. Entire universe U
D. NULL values
Answer: A
💡 Solution:
Tuple variable takes values from an existing relation’s tuples.


Q38.

Which relational calculus query finds departments having no employees?
A. {t | t∈Dept ∧ ¬∃e∈Emp (t.DID = e.DID)}
B. {t | ∃e∈Emp (t.DID = e.DID)}
C. {t | ∀e∈Emp (t.DID ≠ e.DID)}
D. Both A and C
Answer: D
💡 Solution:
Negated existence (A) and universal non-equality (C) are equivalent forms.


Q39.

If a TRC query returns an infinite result, it is said to be:
A. Unsafe
B. Non-relational
C. Recursive
D. Non-deterministic
Answer: A
💡 Solution:
Unsafe queries lack finite domain restrictions.


Q40.

Which of these DRC queries expresses selection?
A. { | R(x,y) ∧ y > 10}
B. { | R(x,y)}
C. { | S(x)}
D. { | y > 10}
Answer: A
💡 Solution:
Predicate y>10 filters tuples → selection.


Q41.

What does the query {<x> | R(x) ∨ S(x)} return?
A. Union of R and S
B. Intersection of R and S
C. Difference R − S
D. Cartesian product
Answer: A
💡 Solution:
Logical OR represents union.


Q42.

Which of the following correctly represents R ∩ S in DRC?
A. { | R(x) ∧ S(x)}
B. { | R(x) ∨ S(x)}
C. { | R(x) ∧ ¬S(x)}
D. { | ¬R(x) ∨ S(x)}
Answer: A
💡 Solution:
Intersection ↔ conjunction (AND).


Q43.

For a database with R(A,B), the query {t | ¬(t∈R)} is:
A. Unsafe
B. Join query
C. Selection
D. Aggregation
Answer: A
💡 Solution:
Negating relation membership introduces infinite tuples → unsafe.


Q44.

Which of the following correctly expresses division R(A,B) ÷ S(B)?
A. {t | ∀s ∈ S ∃r ∈ R (t.A = r.A ∧ r.B = s.B)}
B. {t | ∃s ∈ S ∀r ∈ R (t.A = r.A)}
C. {t | ¬∃s ∈ S (r.B = s.B)}
D. {t | t ∈ R}
Answer: A
💡 Solution:
Division = “for all B in S, A has that B” → universal within existential structure.


Q45.

Which TRC expression returns all tuples of R where B = 10 or C = 20?
A. {t | t∈R ∧ (t.B = 10 ∨ t.C = 20)}
B. {t | t∈R ∧ (t.B = 10 ∧ t.C = 20)}
C. {t | t∈R ∨ t.B = 10}
D. {t | t∈R ∧ t.B > 20}
Answer: A
💡 Solution:
Logical OR inside predicate selects either condition.


Q46.

Which calculus query ensures no duplicate tuples in output?
A. All TRC/DRC queries (by definition)
B. Explicit DISTINCT keyword
C. Aggregation function
D. Use of UNION ALL
Answer: A
💡 Solution:
Relational model treats relations as sets → duplicates not allowed.


Q47.

Which TRC query finds students whose marks are greater than 60 and less than 90?
A. {t | t∈Student ∧ t.Marks > 60 ∧ t.Marks < 90} B. {t | t∈Student ∨ t.Marks > 60}
C. {t | t.Marks > 90}
D. {t | ¬t.Marks < 60}
Answer: A
💡 Solution:
Conjunction restricts range between 60 and 90.


Q48.

Which operator corresponds to difference in relational algebra?
A. ¬ (existential negation)
B. ∨
C. ⇒
D. ∃
Answer: A
💡 Solution:
Difference uses negation to remove matching tuples.


Q49.

Which TRC expression retrieves tuples from R with attribute A equal to constant 5?
A. {t | t∈R ∧ t.A = 5}
B. {t | t.A > 5}
C. {t | ¬(t∈R)}
D. {t | ∃r ∈ R (r.A = 5)}
Answer: A
💡 Solution:
Simple predicate with constant comparison.


Q50.

Which TRC query expresses existence of at least one record in relation R with B = 30?
A. {t | ∃r ∈ R (r.B = 30 ∧ t = r)}
B. {t | ∀r ∈ R (r.B = 30)}
C. {t | ¬∃r ∈ R (r.B ≠ 30)}
D. {t | t∈R ∧ t.B = 30}
Answer: D
💡 Solution:
Direct existential membership satisfying predicate B = 30.

Q51.

Relation: Book(BID, Title, Year, Pages).
Which TRC expression returns BIDs of books published after 2010 with more than 300 pages?
A. {t | ∃b ∈ Book (t.BID = b.BID ∧ b.Year > 2010 ∧ b.Pages > 300)}
B. {t | t.Year > 2010 ∧ t.Pages > 300}
C. {t | ∀b ∈ Book (b.Year > 2010 ∧ b.Pages > 300)}
D. {t | ¬∃b ∈ Book (b.Year ≤ 2010 ∨ b.Pages ≤ 300)}
Answer: A
💡 Solution: A binds b to tuples of Book and projects BID when both predicates hold. B lacks relation binding for t and is unsafe.


Q52.

Let Sale(SID, Prod, Qty) and Prod(PID, Category).
TRC: {t | ∃s ∈ Sale, p ∈ Prod (s.Prod = p.PID ∧ p.Category = 'Gadgets' ∧ t.SID = s.SID)} — what does it produce?
A. Sale IDs for sales of products in category ‘Gadgets’
B. Product IDs in Gadgets
C. All sales tuples not in Gadgets
D. Empty set
Answer: A
💡 Solution: Existential quantifiers join Sale and Prod on product id and project sale id.


Q53.

Which DRC formula corresponds to selection σ(Price < 100)(Item)?
A. {<i,p> | Item(i,p) ∧ p < 100}
B. {<i,p> | Item(i,p) ∨ p < 100}
C. {<i> | ∃p Item(i,p)}
D. {<p> | p < 100}
Answer: A
💡 Solution: DRC expresses attribute values; include predicate p<100 with relation atom.


Q54.

Consider TRC: {t | t ∈ Emp ∧ ¬∃m ∈ Emp (m.Mgr = t.EID)}. What does it return?
A. Employees who are not managers of anyone (no direct reports)
B. Managers only
C. All employees (unsafe)
D. Employees with no manager assigned
Answer: A
💡 Solution: ¬∃m (m.Mgr = t.EID) means no tuple m has t as manager ⇒ t has no direct reports.


Q55.

Which TRC expression correctly captures: “Find students who took every course offered in 2022”? (Relations Student(SID, Name), Offer(CID, Year), Enroll(SID, CID))
A. {t | t ∈ Student ∧ ∀c ∈ Offer (c.Year=2022 ⇒ ∃e ∈ Enroll (e.SID = t.SID ∧ e.CID = c.CID))}
B. {t | t ∈ Student ∧ ∃c ∈ Offer (c.Year=2022 ⇒ ∃e ∈ Enroll ... )}
C. {t | ∃e ∈ Enroll (e.SID = t.SID)}
D. {t | ∀e ∈ Enroll (e.SID = t.SID)}
Answer: A
💡 Solution: For all courses in 2022, there must exist a corresponding enrollment for that student — universal→existential structure implements division.


Q56.

Is the TRC query {t | ∃x (R(x) ∧ t.A = x)} safe if x ranges over R?
A. Yes — x is range-restricted by relation R.
B. No — free variable t is not bound.
C. No — existential makes it unsafe.
D. Yes only if R finite.
Answer: A
💡 Solution: x is bounded to finite relation R, and t is defined in terms of x so it’s safe.


Q57.

Which TRC expression is equivalent to relational algebra π(Name)(Student ⋈ Enroll ⋈ Course WHERE Course.Sem='S1')? (Course(CID, Sem))
A. {t | ∃s ∈ Student, e ∈ Enroll, c ∈ Course (s.SID = e.SID ∧ e.CID = c.CID ∧ c.Sem='S1' ∧ t.Name = s.Name)}
B. {t | ∃s ∈ Student (t.Name = s.Name)}
C. {t | t.Sem = 'S1'}
D. {t | ∀c ∈ Course (c.Sem = 'S1')}
Answer: A
💡 Solution: Joins via equalities and project Name via t.Name binding.


Q58.

Which TRC form is unsafe?
A. {t | ∃x (¬R(x) ∧ t = x)} where R is a relation
B. {t | ∃x (R(x) ∧ t.A = x.A)}
C. {t | t ∈ R ∧ t.B > 5}
D. {t | ∃r ∈ R (t.A = r.A ∧ r.B>0)}
Answer: A
💡 Solution: ¬R(x) is not range restricting; x can be any value from infinite domain → unsafe.


Q59.

Translate to TRC: “Find product ids ordered by at least two distinct customers.” (Order(PID, CustID))
A. {t | ∃o1,o2 ∈ Order (o1.PID=o2.PID ∧ o1.CustID≠o2.CustID ∧ t.PID=o1.PID)}
B. {t | ∃o ∈ Order (t.PID=o.PID)}
C. {t | ∀o ∈ Order (o.PID=t.PID)}
D. {t | ¬∃o ∈ Order (o.PID ≠ t.PID)}
Answer: A
💡 Solution: Two distinct order tuples with same PID but different CustID ensures at least two customers ordered it.


Q60.

Given TRC: {t | t∈R ∧ ∀s ∈ S (s.X = t.X ⇒ s.Y = t.Y)} — what does it express?
A. For each t in R, all S tuples matching on X must have same Y as t (consistency condition)
B. R subset of S
C. S subset of R
D. Always true
Answer: A
💡 Solution: Universal quantification enforces that any S tuple with same X shares Y with t.


Q61.

Which DRC query gives the set of x such that x appears in relation R but not in S (R(A) and S(A)) ?
A. {<x> | R(x) ∧ ¬S(x)}
B. {<x> | R(x) ∨ S(x)}
C. {<x> | ¬R(x)}
D. {<x> | ∃y R(y)}
Answer: A
💡 Solution: Conjunction with negation expresses set difference R − S.


Q62.

Which TRC expression is equivalent to algebra R ⋈ S when R(A,B) and S(B,C)?
A. {t | ∃r ∈ R, s ∈ S (r.B = s.B ∧ t.A = r.A ∧ t.B = r.B ∧ t.C = s.C)}
B. {t | t ∈ R}
C. {t | ∀r ∈ R (r.B = t.B)}
D. {t | r.B = s.B}
Answer: A
💡 Solution: Existential bind both relations and equate join attribute; project combined attributes.


Q63.

Which calculus pattern yields the intersection of R(A) and S(A)?
A. {<x> | R(x) ∧ S(x)}
B. {<x> | R(x) ∨ S(x)}
C. {<x> | R(x) ∧ ¬S(x)}
D. {<x> | ¬R(x)}
Answer: A
💡 Solution: AND requires x to be in both relations.


Q64.

Which of these TRC forms correctly represents: “Customers who did not buy product P9 in year 2023”? (Order(cust,pid,odate))
A. {t | t ∈ Customer ∧ ¬∃o ∈ Order (o.Cust = t.Cust ∧ o.PID='P9' ∧ EXTRACT(YEAR FROM o.odate)=2023)}
B. {t | ∃o ∈ Order (o.PID='P9')}
C. {t | t.Cust='P9'}
D. {t | ∀o ∈ Order (o.PID='P9')}
Answer: A
💡 Solution: Negated existential prevents any 2023 order of P9 for the customer.


Q65.

Which DRC expression is unsafe?
A. {<x> | ∃y (R(x,y) ∧ y>0)}
B. {<x> | x>0}
C. {<x> | R(x,y) ∧ S(y)} if y is properly quantified
D. {<x> | ∃y (R(x,y))}
Answer: B
💡 Solution: x>0 with no relation atom bounding x is unbounded → infinite domain → unsafe.


Q66.

Express in TRC: “Find employees who report (directly) to a manager in Dept 30.” (Emp(EID,MID,Dept))
A. {t | t∈Emp ∧ ∃m ∈ Emp (m.EID = t.MID ∧ m.Dept = 30)}
B. {t | t.Dept = 30}
C. {t | ∀m ∈ Emp (m.Dept = 30)}
D. {t | t.MID = 30}
Answer: A
💡 Solution: Existentially find manager tuple m whose Dept=30, equate manager id.


Q67.

Which TRC query returns A values from R(A,B) that pair with all B values present in S(B)?
A. {t | ∃r ∈ R (t.A = r.A ∧ ∀s ∈ S ∃r2 ∈ R (r2.A = r.A ∧ r2.B = s.B))}
B. {t | ∃r ∈ R (t.A = r.A)}
C. {t | ∀r ∈ R (r.B = t.A)}
D. {t | ¬∃s ∈ S (s.B = t.A)}
Answer: A
💡 Solution: Nested universal-existential captures division: for every s in S there exists R tuple linking that A to s.B.


Q68.

Which TRC expression is logically equivalent to {t | t∈R ∧ ¬∃s∈S (s.K = t.K)} ?
A. {t | t∈R ∧ ∀s∈S (s.K ≠ t.K)}
B. {t | t∈R ∨ ∀s∈S (s.K ≠ t.K)}
C. {t | ∃s ∈ S (s.K = t.K)}
D. {t | ¬t∈R}
Answer: A
💡 Solution: Negated existential equals universal non-equality (De Morgan on quantifiers).


Q69.

Given R(A,B) and S(A,B), which TRC query describes R ∆ S (symmetric difference)?
A. {t | (t ∈ R ∧ ¬∃s∈S (s.A=t.A ∧ s.B=t.B)) ∨ (t ∈ S ∧ ¬∃r∈R (r.A = t.A ∧ r.B = t.B))}
B. {t | t ∈ R}
C. {t | t ∈ S}
D. {t | ∃u (u.A = t.A)}
Answer: A
💡 Solution: Symmetric difference = tuples in R but not S OR in S but not R.


Q70.

Which TRC expression is safe and returns the Name of students who share a mark with at least one other student? (Student(SID,Name,Marks))
A. {t | ∃s1,s2 ∈ Student (s1.SID ≠ s2.SID ∧ s1.Marks = s2.Marks ∧ t.Name = s1.Name)}
B. {t | ∃s ∈ Student (t.Name = s.Name)}
C. {t | ∀s1,s2 (s1.Marks = s2.Marks)}
D. {t | ¬∃s (s.Marks = t.Marks)}
Answer: A
💡 Solution: Two different students with same Marks; project the name for one of them. Variables are range-restricted.


Q71.

Is the TRC {t | ∃s ∈ R (t.A = s.A) ∧ ∃u (u > 5)} safe?
A. No — u is unbounded by any relation
B. Yes — both quantifiers existential make it safe
C. Yes — because u>5 restricts it
D. No — s is unbounded
Answer: A
💡 Solution: The variable u has no relation atom bounding it, so domain is unbounded → unsafe.


Q72.

Which TRC expression computes projection π(B)(R) for R(A,B,C)?
A. {t | ∃r ∈ R (t.B = r.B)}
B. {t | ∀r ∈ R (t.B = r.B)}
C. {t | t ∈ R}
D. {t | ∃r ∈ R (t.A = r.A)}
Answer: A
💡 Solution: Existentially bind a tuple and project its B component.


Q73.

Given TRC {t | ∃r ∈ R (t.A = r.A ∧ r.B < 0) ∧ ¬∃s ∈ S (s.C = r.A)}, which English description is correct?
A. Tuples t whose A appears in R with negative B and that A does not appear as C in S
B. All tuples of R with negative B
C. Tuples t in S with C negative
D. None
Answer: A
💡 Solution: Conjunction of existence in R with negative B and non-existence in S describes the stated set.


Q74.

Which of the following DRC queries is unsafe? Assume R(x) and S(y) exist.
A. {<x> | R(x) ∨ S(x)}
B. {<x> | x > 1000}
C. {<x> | ∃y (R(y) ∧ x = y)}
D. {<x> | R(x) ∧ ¬S(x)}
Answer: B
💡 Solution: x>1000 without relation bound allows infinitely many domain values → unsafe.


Q75.

Which TRC pattern correctly expresses: “There exists an author who wrote books in both 2018 and 2022”? (Book(BID, Author, Year))
A. {t | ∃b1, b2 ∈ Book (b1.Author = b2.Author ∧ b1.Year = 2018 ∧ b2.Year = 2022 ∧ t.Author = b1.Author)}
B. {t | ∀b (b.Year = 2018 ∧ b.Year = 2022)}
C. {t | ∃b (b.Year = 2018 ∨ b.Year = 2022)}
D. {t | ¬∃b (b.Year = 2018 ∧ b.Year = 2022)}
Answer: A
💡 Solution: Needs two Book tuples with same Author but different Year values; existential pair enforces that.

Q76.

Relation Movie(MID, Title, Year, Rating).
Which TRC expression returns MIDs of movies rated ≥ 8.5 released after 2015?
A. {t | ∃m ∈ Movie (t.MID = m.MID ∧ m.Rating >= 8.5 ∧ m.Year > 2015)}
B. {t | ∀m ∈ Movie (m.Rating >= 8.5 ∧ m.Year > 2015)}
C. {t | ¬∃m ∈ Movie (m.Rating < 8.5)}
D. {t | t.Rating >= 8.5}
Answer: A
💡 Solution: Existentially bind m to Movie and project MID when both predicates hold; other forms are unsafe or incorrect.


Q77.

Given A(X,Y) and B(Y,Z), which TRC describes π_X(A ⋈ B)?
A. {t | ∃a ∈ A, b ∈ B (a.Y = b.Y ∧ t.X = a.X)}
B. {t | ∀a ∈ A (t.X = a.X)}
C. {t | ∃b ∈ B (t.X = b.Z)}
D. {t | t ∈ A}
Answer: A
💡 Solution: Existential join binds A and B by Y, and projects A.X.


Q78.

Which TRC expression is equivalent to relational algebra R − S when both have (A,B)?
A. {t | t ∈ R ∧ ¬∃s ∈ S (s.A = t.A ∧ s.B = t.B)}
B. {t | t ∈ S ∧ ¬∃r ∈ R (r.A = t.A)}
C. {t | ∃s ∈ S (s.A != t.A)}
D. {t | t ∈ R ∨ t ∈ S}
Answer: A
💡 Solution: Negated existential excludes any tuple that also occurs in S.


Q79.

TRC: {t | ∃r∈R (t.A = r.A) ∧ ∀s∈S (s.B ≠ t.A)} — is it safe?
A. Yes, if domains of R and S are finite (they are relations) and t is range-restricted via r
B. No — universal quantifier makes it unsafe always
C. No — t not bound to S
D. Yes only if S empty
Answer: A
💡 Solution: t is tied to r∈R so range-restricted; universal on S is okay because S finite; expression is safe.


Q80.

Which DRC query yields elements present in exactly one of R(A) or S(A) (symmetric difference)?
A. {<x> | (R(x) ∧ ¬S(x)) ∨ (S(x) ∧ ¬R(x))}
B. {<x> | R(x) ∧ S(x)}
C. {<x> | R(x) ∨ S(x)}
D. {<x> | ¬R(x)}
Answer: A
💡 Solution: XOR logic via (R and not S) OR (S and not R) implements symmetric difference.


Q81.

Which TRC expression returns Dept values that have at least one employee with salary > 1,00,000? (Emp(EID, Dept, Sal))
A. {t | ∃e ∈ Emp (e.Dept = t.Dept ∧ e.Sal > 100000)}
B. {t | ∀e ∈ Emp (e.Sal > 100000)}
C. {t | t.Dept = 'HR'}
D. {t | ¬∃e ∈ Emp (e.Sal > 100000)}
Answer: A
💡 Solution: Existential quantifier finds existence of at least one high-salary employee per department and projects Dept.


Q82.

Translate to TRC: “Find student IDs who took no course offered in Semester = ‘S2’.” (Offer(CID, Sem), Enroll(SID,CID))
A. {t | t ∈ Student ∧ ¬∃c ∈ Offer (c.Sem='S2' ∧ ∃e ∈ Enroll (e.SID = t.SID ∧ e.CID = c.CID))}
B. {t | ∃c ∈ Offer (c.Sem='S2' ∧ ¬∃e ∈ Enroll (e.SID = t.SID ∧ e.CID = c.CID))}
C. {t | ∃e ∈ Enroll (e.SID = t.SID)}
D. {t | t.Sem = 'S2'}
Answer: A
💡 Solution: For each Student t, ensure no Offer in S2 exists such that the student enrolled in it (negated existential over nested existential achieves anti-membership).


Q83.

Which TRC form correctly expresses: “There exists an author who has written at least three distinct books”? (Book(BID, Author))
A. {t | ∃b1,b2,b3 ∈ Book (b1.Author = b2.Author ∧ b2.Author = b3.Author ∧ b1.BID ≠ b2.BID ∧ b1.BID ≠ b3.BID ∧ b2.BID ≠ b3.BID ∧ t.Author = b1.Author)}
B. {t | ∃b ∈ Book (t.Author = b.Author)}
C. {t | ∀b ∈ Book (b.Author = t.Author)}
D. {t | ¬∃b ∈ Book (b.Author = t.Author)}
Answer: A
💡 Solution: Three existentially bound book tuples with same Author but pairwise distinct BIDs implement “at least three distinct books.”


Q84.

Given TRC {t | t ∈ R ∧ ∃s ∈ S (s.X = t.X)} — which algebraic operation does it map to?
A. Projection of R after semi-join with S on X (i.e., semijoin R ⋉ S projected as R rows with match)
B. Cartesian product R × S
C. Difference R − S
D. Union R ∪ S
Answer: A
💡 Solution: Existence of matching s in S selects R tuples having counterpart in S — semijoin behavior.


Q85.

Which TRC query is equivalent to DRC {<a> | ∃b (R(a,b) ∧ S(b))}?
A. {t | ∃r ∈ R, s ∈ S (r.A = t.a ∧ r.B = s.B)} (with appropriate attribute naming)
B. {t | ∀r ∈ R (r.A = t.a ∧ r.B = s.B)}
C. {t | ∃r ∈ R (r.A = t.a)}
D. {t | t.A > 0}
Answer: A
💡 Solution: Convert domain quantification into tuple quantifiers binding R and S, matching attributes accordingly.


Q86.

Is {t | ∃r ∈ R (t.A = r.A) ∧ ∃s ∈ S (t.A = s.B)} equivalent to {t | ∃r ∈ R, s ∈ S (t.A = r.A ∧ r.A = s.B)}?
A. Yes — conjunction of two existentials can be combined into single existential over both relations.
B. No — they differ in semantics
C. Only if R and S disjoint
D. None
Answer: A
💡 Solution: Independent exists can be merged into a single existential binding both variables (scoping unchanged), giving same meaning.


Q87.

Which TRC expression returns authors who did not write any book in 2020? (Book(BID,Author,Year))
A. {t | t ∈ Author ∧ ¬∃b ∈ Book (b.Author = t.Author ∧ b.Year = 2020)}
B. {t | ∃b ∈ Book (b.Year ≠ 2020)}
C. {t | ∀b ∈ Book (b.Year = 2020)}
D. {t | t.Year ≠ 2020}
Answer: A
💡 Solution: Negated existential over Book with Year = 2020 ensures authors without 2020 books.


Q88.

Given R(A,B) and S(A), which TRC query finds A values in R that are not in S?
A. {t | ∃r ∈ R (t.A = r.A ∧ ¬S(r.A))} (tweak: use ¬∃s∈S(s.A = r.A))
B. {t | ∃r ∈ R (t.A = r.A ∧ ¬∃s ∈ S (s.A = r.A))}
C. {t | ∃s ∈ S (t.A = s.A)}
D. {t | t ∈ S}
Answer: B
💡 Solution: Need to check non-existence in S for same A; B is correct safe pattern (A form is shorthand but must formalize ¬∃s).


Q89.

Which TRC expression corresponds to the algebra π(A)(R ⋈ S) when R(A,B) and S(B)?
A. {t | ∃r ∈ R, s ∈ S (r.B = s.B ∧ t.A = r.A)}
B. {t | t.A ∈ R.A}
C. {t | ∀s ∈ S (r.B = s.B)}
D. {t | t ∈ S}
Answer: A
💡 Solution: Existentially join and project A.


Q90.

Which of the following TRC forms is safe?
A. {t | ∃x (x > 0 ∧ t.A = x)} with x unbounded
B. {t | ∃r ∈ R (t.A = r.A)}
C. {t | ¬∃x (x > 5)}
D. {t | ∀x t.A = x}
Answer: B
💡 Solution: B range-restricts variable via R; others include unbounded variables or impossible universal constraints.


Q91.

Which TRC query represents “Find students who have taken no course more than once”? (Enroll(SID,CID))
A. {t | t ∈ Student ∧ ¬∃c ∈ Course (∃e1,e2 ∈ Enroll (e1.SID = t.SID ∧ e2.SID = t.SID ∧ e1.CID = c.CID ∧ e2.CID = c.CID ∧ e1.EID ≠ e2.EID))} (note: e rows identification by rowid)
B. {t | ∃e ∈ Enroll (e.SID = t.SID)}
C. {t | ∃c ∈ Course (∃e ∈ Enroll (e.SID = t.SID ∧ e.CID = c.CID ∧ COUNT(e)>1))} (COUNT not allowed in pure calculus)
D. {t | t.SID = 1}
Answer: A
💡 Solution: Use negated existential over existence of two distinct enrollments (distinct rows) for same student and course; pure relational calculus models row distinctness via multiple tuple variables.


Q92.

Which DRC expression is equivalent to σ(B=10)(R) for relation R(A,B,C)?
A. {<a,c> | R(a,10,c)}
B. {<a,b> | R(a,b,c) ∧ b=10}
C. {<a,b,c> | b=10}
D. {<b> | b=10}
Answer: A
💡 Solution: DRC returns attribute lists; specify the constant in the relation atom and include the attributes to be returned (A and C after selection on B).


Q93.

Which TRC query finds managers who manage exactly one employee? (Emp(EID, MgrID))
A. {t | ∃m ∈ Emp (m.EID = t.EID ∧ ∃e1,e2 ∈ Emp (e1.MgrID = m.EID ∧ e2.MgrID = m.EID ∧ e1.EID ≠ e2.EID) ⇒ false)} — complex
B. {t | ∃m ∈ Emp (m.EID = t.EID ∧ ∃e ∈ Emp (e.MgrID = m.EID) ∧ ¬∃e2 ∈ Emp (e2.MgrID = m.EID ∧ e2.EID ≠ e.EID))}
C. {t | ∃e1,e2 ∈ Emp (e1.MgrID = t.EID ∧ e2.MgrID = t.EID ∧ e1.EID ≠ e2.EID)}
D. {t | t.EID = 1}
Answer: B
💡 Solution: B asserts existence of one report and denies existence of a second distinct report; C finds managers with at least two reports (wrong).


Q94.

Which TRC expression returns A values in R that pair with all B values that appear in R? (R(A,B)) — i.e., A values associated with every B in R.
A. {t | ∃r ∈ R (t.A = r.A ∧ ∀b (∃s ∈ R (s.B = b) ⇒ ∃s2 ∈ R (s2.A = r.A ∧ s2.B = b)))}
B. {t | ∃r ∈ R (t.A = r.A)}
C. {t | ∀b ∈ R (t.A = b)}
D. {t | t.A ∈ π_A(R)}
Answer: A
💡 Solution: For every B that appears anywhere in R, there must exist an R-tuple linking the candidate A to that B — nested universal→existential pattern captures division semantics across same relation.


Q95.

Which TRC pattern correctly expresses: “There is no student who scored 100 in all subjects”? (Marks(SID, Subj, Score))
A. {t | ¬∃s ∈ Student (∀m ∈ Marks (m.SID = s.SID ⇒ m.Score = 100))}
B. {t | ∃s ∈ Student (∀m ∈ Marks (m.SID = s.SID ⇒ m.Score = 100))}
C. {t | ∀s ∈ Student (∃m ∈ Marks (m.Score ≠ 100))}
D. {t | ∃m ∈ Marks (m.Score ≠ 100)}
Answer: A
💡 Solution: Negated existence of a student satisfying universal all-scores=100 expresses “no student has 100 in all subjects.”


Q96.

Given R(A,B,C) and TRC {t | ∃r ∈ R (t.A = r.A ∧ r.B + r.C > 50)} — which algebraic expression is equivalent?
A. π_A(σ(B + C > 50)(R))
B. σ(B + C > 50)(π_A(R))
C. π_A(R)
D. R
Answer: A
💡 Solution: Project A from R after selecting tuples where B+C>50.


Q97.

Which TRC query is unsafe due to an unbounded free variable?
A. {t | ∃r ∈ R (t.A = r.A ∧ x > 100)} where x not range-restricted
B. {t | ∃r ∈ R (t.A = r.A ∧ r.B > 0)}
C. {t | t ∈ R ∧ t.B < 50}
D. {t | ∃r ∈ R (t.A = r.A)}
Answer: A
💡 Solution: Variable x is not bound by any relation atom → domain-unbounded → unsafe.


Q98.

Which DRC query denotes the set of pairs <a,b> where R(a,b) holds and there does not exist c with S(b,c)?
A. {<a,b> | R(a,b) ∧ ¬∃c S(b,c)}
B. {<a,b> | R(a,b) ∨ ∃c S(b,c)}
C. {<a> | ∃b R(a,b)}
D. {<b,c> | S(b,c)}
Answer: A
💡 Solution: Conjoin R and negated existential on S to ensure no related c exists.


Q99.

Which TRC expression returns departments that have exactly two employees? (Emp(EID,Dept))
A. {t | ∃e1,e2 ∈ Emp (e1.Dept = t.Dept ∧ e2.Dept = t.Dept ∧ e1.EID ≠ e2.EID ∧ ¬∃e3 ∈ Emp (e3.Dept = t.Dept ∧ e3.EID ≠ e1.EID ∧ e3.EID ≠ e2.EID))}
B. {t | ∃e1,e2,e3 ∈ Emp (...)} — excessive
C. {t | ∃e ∈ Emp (t.Dept = e.Dept)}
D. {t | t.Dept = 'D1'}
Answer: A
💡 Solution: Existentially assert two distinct employees and negate existence of any third distinct employee in same dept; implements exact-count semantics using pure calculus.


Q100.

Which TRC expression corresponds to SQL SELECT DISTINCT A FROM R WHERE NOT EXISTS (SELECT 1 FROM S WHERE S.B = R.B) (i.e., A values from R whose B not present in S)?
A. {t | ∃r ∈ R (t.A = r.A ∧ ¬∃s ∈ S (s.B = r.B))}
B. {t | ∃r ∈ R (t.A = r.A ∧ ∃s ∈ S (s.B = r.B))}
C. {t | ∀r ∈ R (t.A = r.A)}
D. {t | ¬∃r ∈ R (r.A = t.A)}
Answer: A
💡 Solution: Bind to R to project A and ensure there is no S with same B via negated existential — direct calculus translation of the SQL anti-join.