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 1–5 of 31

Q1GATE 2024 (Session 2)2 marksMCQ−0.67 if wrong
The relation schema, Person(pid,city), describes the city of residence for every person uniquely identified by pid. The following relational algebra operators are available: selection, projection, cross product, and rename.

To find the list of cities where at least 3 persons reside, using the above operators, the minimum number of cross product operations that must be used is

Q2GATE 20221 markMSQ
Consider the following three relations in a relational database.
Employee(eId,Name),Brand(bId,bName),Own(eId,bId)Employee(eId, Name), Brand (bId, bName), Own(eId ,bId)
Which of the following relational algebra expressions return the set of eIdseIds who own all the brands?

One or more options are correct.

Q3GATE 2021 (Session 1)1 markNAT
A relation r(A,B)r(A,B) in a relational database has 1200 tuples. The attribute AA has integer values ranging from 6 to 20, and the attribute BB has integer values ranging from 1 to 20. Assume that the attributes AA and BB are independently distributed.

The estimated number of tuples in the output of σ(A>10)∨(B=18)(r)\sigma _{(A \gt 10)\vee(B=18)}(r) is ____________

Q4GATE 2021 (Session 1)2 marksMCQ−0.67 if wrong
The following relation records the age of 500 employees of a company, where empNo ( indicating the employee number) is the key:

empAge(empNo‾,age)empAge(\underline{empNo},age)

Consider the following relational algebra expression:

ΠempNo(empAge⋈(age>age1)ρempNo1,age1(empAge))\Pi_{empNo}(empAge \Join_{(age \gt age1)} \rho_{empNo1,age1}(empAge))

What does the above expression generate?

Q5GATE 20192 marksNAT
Consider the following relation P(X, Y, Z), Q(X, Y, T) and R(Y, V):
PQR XYZ XYT YV X1Y1Z1 X1Y1Z2 X2Y2Z2 X2Y4Z4 X2Y12 X1Y25 X1Y16 X3Y31 Y1V1 Y3V2 Y2V3 Y2V2
How many tuples will be returned by the following relational algebra query?
∏X(σ(P.Y=R.Y ∧ R.V=V2)(P×R))−∏X(σ(Q.Y=R.Y ∧ Q.T>2)(Q×R))\prod_{X}\left(\sigma_{(P.Y=R.Y\ \wedge\ R.V=\text{V2})}(P\times R)\right)-\prod_{X}\left(\sigma_{(Q.Y=R.Y\ \wedge\ Q.T\gt 2)}(Q\times R)\right)
Answer:______

Keep practising

Topics in Databases

All CS topics ›