Relational Algebra: GATE CS Previous Year Questions

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

Q11GATE 2014 (Session 3)2 marksMCQ−0.67 if wrong
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.
employee (empId, empName, empAge)
dependent(depId, eId, depName, depAge)
Consider the following relational algebra query:
ΠempId(employee)−ΠempId(employee⋈(empId = eID)∧(empAge≤depAge)dependent)\Pi_{\text{empId}}(\text{employee}) - \Pi_{\text{empId}}\left(\text{employee} \bowtie_{(\text{empId = eID}) \wedge (\text{empAge} \le \text{depAge})} \text{dependent}\right)
The above query evaluates to the set of empIds of employees whose age is greater than that of

Q12GATE 20122 marksMCQ−0.67 if wrong
Consider the following relations A, B and C:
A Id Name Age 12 Arun 60 15 Shreya 24 99 Rohit 11 B Id Name Age 15 Shreya 24 25 Hari 40 98 Rohit 20 99 Rohit 11 C Id Phone Area 10 2200 02 99 2100 01
How many tuples does the result of the following relational algebra expression contain? Assume that the schema of A∪\cupB is the same as that of A.
(A∪B)⋈A.Id>40∨C.Id<15C(A\cup B)\bowtie _{A.Id \gt 40 \vee C.Id \lt 15}C

Q13GATE 20122 marksMCQ−0.67 if wrong
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?

Q14GATE 20112 marksMCQ−0.67 if wrong
Consider a relational table r with sufficient number of records, having attributes A1,A2,...,AnA_{1}, A_{2},..., A_{n} and let 1≤p≤n1\leq p\leq n . Two queries Q1 and Q2 are given below.

Q1:πA1....An(σAp=c(r))Q1:\pi _{A_{1}....A_{n}}(\sigma _{A_{p}=c}(r)) where c is a constant
Q2:πA1....An(σc1≤Ap≤c2(r))Q2:\pi _{A1....A_{n}}(\sigma _{c_{1}\leq A_{p}\leq c_{2}}(r)) where c1c_{1} and c2c_{2} are constants

The database can be configured to do ordered indexing on ApA_{p} or hashing on ApA_{p}.

Which of the following statements is TRUE?

Q15GATE 20102 marksMCQ−0.67 if wrong
The following functional dependencies hold for relations R(A, B, C) and S(B, D, E)

B →\rightarrowA,
A →\rightarrowC

The relation R contains 200tuples and the relation S contains 100tuples. What is the maximum number of tuples possible in the natural join R⋈\Join S?

Keep practising

Topics in Databases

All CS topics ›