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 6–8 of 8
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?
Answer: (C)
The condition must hold for every tuple :
Reorder the OR terms (OR is commutative and associative):
Use , with = (employee(x) and x.sex is not male). Since sex is male or female, this is:
So for every female employee , her supervisor is not . Employee is not the direct supervisor of any female employee: has no immediate female subordinates.
Options (A) and (D) talk about the supervisor of , but the query compares with , so is a subordinate of . Option (B) is wrong because male subordinates are allowed; only female ones are ruled out.
Answer: (C)
Reorder the OR terms (OR is commutative and associative):
Use , with = (employee(x) and x.sex is not male). Since sex is male or female, this is:
So for every female employee , her supervisor is not . Employee is not the direct supervisor of any female employee: has no immediate female subordinates.
Options (A) and (D) talk about the supervisor of , but the query compares with , so is a subordinate of . Option (B) is wrong because male subordinates are allowed; only female ones are ruled out.
Answer: (C)
Which of the following relational query languages have the same expressive power?
I. Relational algebra
II. Tuple relational calculus restricted to safe expressions
III. Domain relational calculus restricted to safe expressions
I. Relational algebra
II. Tuple relational calculus restricted to safe expressions
III. Domain relational calculus restricted to safe expressions
Answer: (D)
By Codd's theorem, relational algebra, tuple relational calculus restricted to safe expressions, and domain relational calculus restricted to safe expressions all have the same expressive power. Any query written in one can be written in the others. The restriction to safe expressions is needed because unrestricted calculus can express queries with infinite results, such as all tuples not in a relation, which algebra cannot.
So all three, I, II and III, are equivalent.
Answer: (D)
So all three, I, II and III, are equivalent.
Answer: (D)
Which of the following relational calculus expressions is not safe ?
Answer: (C)
Answer: C.
This expression gives all tuples that are not in R1. There are infinitely many such tuples, so the expression is not safe.
Reference: https://people.cs.pitt.edu/~chang/156/10calculus.html
Keep practising
Topics in Databases
ER ModelRelational SchemaRelational Algebra
Tuple CalculusYou are here
SQLIntegrity ConstraintsNormal FormFile SystemTransaction