Relational Algebra · Databases
31 questions · asked in 19 of 27 years (2000–2026)
MCQ 27 · MSQ 1 · NAT 31-mark 17 · 2-mark 14
2000Questions per year2026
Questions 11–15 of 31
Consider the relational schema given below, where eId of the relation dependentis a foreign key referring to empId of the relation employee. Assume that every employee has at least one associated dependent in the dependent relation.
The above query evaluates to the set of empIds of employees whose age is greater than that of
employee (empId, empName, empAge)
dependent(depId, eId, depName, depAge) Consider the following relational algebra query:The above query evaluates to the set of empIds of employees whose age is greater than that of
Answer: (D)
The join picks the employees who have at least one dependent of their own (eId = empId) whose age is the employee's age.
When we take these away from the set of all employees, we are left with the employees who are older than every one of their own dependents.
Answer: all of his/her dependents
When we take these away from the set of all employees, we are left with the employees who are older than every one of their own dependents.
Answer: all of his/her dependents
Consider the following relations A, B and C:
How many tuples does the result of the following relational algebra expression contain? Assume that the schema of AB is the same as that of A.
How many tuples does the result of the following relational algebra expression contain? Assume that the schema of AB is the same as that of A.
Answer: (A)
The union A B, with duplicates removed, gives 5 tuples. Their Ids are 12, 15, 99, 25, 98.
- Take C.Id = 10. The condition 10 15 is true, so all 5 tuples match.
- Take C.Id = 99. Only tuples with Id 40 match. These are 99 and 98 2 tuples.
Total = 5 + 2 = 7
Answer: 7
- Take C.Id = 10. The condition 10 15 is true, so all 5 tuples match.
- Take C.Id = 99. Only tuples with Id 40 match. These are 99 and 98 2 tuples.
Total = 5 + 2 = 7
Answer: 7
Suppose R1(A, B) and R2(C, D) are two relation schemas. Let r1 and r2 be the corresponding relation instances. B is a foreign key that refers to C in R2. If data in r1 and r2 satisfy referential integrity constraints, which of the following is ALWAYS TRUE?
Answer: (A)
Under referential integrity, each B value in r1 must also be present as a C value in r2. This gives , which means .
Both sides need not be equal, because r2 may hold C values that no tuple in r1 refers to.
Answer:
Both sides need not be equal, because r2 may hold C values that no tuple in r1 refers to.
Answer:
Consider a relational table r with sufficient number of records, having attributes and let . Two queries Q1 and Q2 are given below.
where c is a constant
where and are constants
The database can be configured to do ordered indexing on or hashing on .
Which of the following statements is TRUE?
where c is a constant
where and are constants
The database can be configured to do ordered indexing on or hashing on .
Which of the following statements is TRUE?
Answer: (C)
Let us look at each query in turn:
- Q1 is an equality search. A hash index can find the record in about one access. This is faster than going down a tree.
- Q2 is a range search. Hashing spreads the values out, so it cannot handle a range. An ordered index can handle it.
Answer: Hashing will outperform ordered indexing on Q1, but not on Q2
- Q1 is an equality search. A hash index can find the record in about one access. This is faster than going down a tree.
- Q2 is a range search. Hashing spreads the values out, so it cannot handle a range. An ordered index can handle it.
Answer: Hashing will outperform ordered indexing on Q1, but not on Q2
The following functional dependencies hold for relations R(A, B, C) and S(B, D, E)
B A,
A C
The relation R contains 200tuples and the relation S contains 100tuples. What is the maximum number of tuples possible in the natural join R S?
B A,
A C
The relation R contains 200tuples and the relation S contains 100tuples. What is the maximum number of tuples possible in the natural join R S?
Answer: (A)
Look at R. We have B A and A C, so B is a key of R. When we join on B, each tuple of S matches at most one tuple of R.
Maximum size of the join = |S| = 100
Answer: 100
Maximum size of the join = |S| = 100
Answer: 100
Keep practising
Topics in Databases
ER ModelRelational Schema
Relational AlgebraYou are here
Tuple CalculusSQLIntegrity ConstraintsNormal FormFile SystemTransaction