Tuple Calculus · Databases
8 questions · asked in 8 of 27 years (2000–2026)
MCQ 7 · NAT 11-mark 5 · 2-mark 3
2000Questions per year2026
Questions 1–5 of 8
Consider a relational database schema with two relations and . Let be a tuple relational calculus expression.
Which one of the following relational algebraic expressions is equivalent to ?
Which one of the following relational algebraic expressions is equivalent to ?
Answer: (B)
gives every for which some tuple is in and a tuple with the same is in .
The second attribute of () plays the role of , and so does the first attribute of (). So we need a join with the condition . Because and have no common attribute names, this must be written as an explicit equi-join; a natural join would give a Cartesian product. Then we keep only , which is .
. A join is commutative, so writing or first makes no difference.
Why the others fail: (A) and (C) compare , which is , instead of . (D) compares , which is , with .
Answer: (B)
The second attribute of () plays the role of , and so does the first attribute of (). So we need a join with the condition . Because and have no common attribute names, this must be written as an explicit equi-join; a natural join would give a Cartesian product. Then we keep only , which is .
. A join is commutative, so writing or first makes no difference.
Why the others fail: (A) and (C) compare , which is , instead of . (D) compares , which is , with .
Answer: (B)
Consider two relations describing teams and players in a sports league:
are team-id and team-name, respectively
denote player-id, player-name and the team-id of the player, respectively
Which ONE of the following tuple relational calculus queries returns the name of the players who play for the team having name as 'MI'?
are team-id and team-name, respectively
denote player-id, player-name and the team-id of the player, respectively
Which ONE of the following tuple relational calculus queries returns the name of the players who play for the team having name as 'MI'?
Answer: (A)
For each player in , we need the name. We keep only those players whose is the same as that of some team in where .
This gives the query:
Two things must be checked. First, the outer variable must range over and not over , because we need player names. Second, the join condition must be present inside the existential. Options that leave out this join condition would return the name of every player whenever team 'MI' exists, whichever team the player is on.
Answer: {p.pname | p∈players ∧ ∃t(t∈teams ∧ p.tid=t.tid ∧ t.tname='MI')}
This gives the query:
Two things must be checked. First, the outer variable must range over and not over , because we need player names. Second, the join condition must be present inside the existential. Options that leave out this join condition would return the name of every player whenever team 'MI' exists, whichever team the player is on.
Answer: {p.pname | p∈players ∧ ∃t(t∈teams ∧ p.tid=t.tid ∧ t.tname='MI')}
Consider the following two relations, and :
The total number of tuples obtained by evaluating the following expression is ____
The total number of tuples obtained by evaluating the following expression is ____
Answer: 2
Join the tables where holds:
- A = 10: (10, 20, 90) so the condition is True
- A = 30: (30, 40, 45) so the condition is True
- A = 30: (30, 50, 45) so the condition is False
(A = 20 and A = 50 in R, and A = 40 in S, have no matching tuple.)
Answer: 2
- A = 10: (10, 20, 90) so the condition is True
- A = 30: (30, 40, 45) so the condition is True
- A = 30: (30, 50, 45) so the condition is False
(A = 20 and A = 50 in R, and A = 40 in S, have no matching tuple.)
Answer: 2
Let R and S be relational schemes such that R={a,b,c} and S={c}. Now consider
the following queries on the database:
IV. Select R.a, R.b From R,S Where R.c=S.c
Which of the above queries are equivalent?
IV. Select R.a, R.b From R,S Where R.c=S.c
Which of the above queries are equivalent?
Answer: (A)
Here and holds values. The first three queries differ in the quantifier on and .
I. lists all pairs. Taking the product with gives every pair with every of . Subtracting leaves the combinations that are missing from . Projecting to gives the pairs that miss at least one of . Removing these from all pairs leaves the pairs that occur with every in . This is the division .
II. is an pair such that for every in some tuple of has and . This is also .
III. The quantifiers are swapped: for every tuple of , 's must equal and its must be in . So must be the of every tuple of . This is not division.
IV. The SQL query joins on and returns of each tuple of whose is in , with duplicates. It has no "for all" condition.
Example: , . I and II give only , the one pair seen with both 12 and 14. III gives nothing, because the tuples of have different values. IV gives twice, and .
So I and II are equivalent.
Answer: (A)
I. lists all pairs. Taking the product with gives every pair with every of . Subtracting leaves the combinations that are missing from . Projecting to gives the pairs that miss at least one of . Removing these from all pairs leaves the pairs that occur with every in . This is the division .
II. is an pair such that for every in some tuple of has and . This is also .
III. The quantifiers are swapped: for every tuple of , 's must equal and its must be in . So must be the of every tuple of . This is not division.
IV. The SQL query joins on and returns of each tuple of whose is in , with duplicates. It has no "for all" condition.
Example: , . I and II give only , the one pair seen with both 12 and 14. III gives nothing, because the tuples of have different values. IV gives twice, and .
So I and II are equivalent.
Answer: (A)
Which of the following tuple relational calculus expression(s) is/are equivalent to ?
I.
II.
III.
IV.
I.
II.
III.
IV.
Answer: (C)
says every tuple of satisfies . Its negation is that some tuple of fails : . So the statement itself equals , which is III.
I says no tuple of satisfies . That is much stronger. If has one tuple and holds for it, the given formula is true but I is false.
II is a double negation of membership, , which just says is in . It does not say that holds for all tuples.
IV says some tuple of fails . This is the opposite (negation) of the given formula.
Answer: (C)
I says no tuple of satisfies . That is much stronger. If has one tuple and holds for it, the given formula is true but I is false.
II is a double negation of membership, , which just says is in . It does not say that holds for all tuples.
IV says some tuple of fails . This is the opposite (negation) of the given formula.
Answer: (C)
Keep practising
Topics in Databases
ER ModelRelational SchemaRelational Algebra
Tuple CalculusYou are here
SQLIntegrity ConstraintsNormal FormFile SystemTransaction