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 16–20 of 31

Q16GATE 20082 marksMCQ−0.67 if wrong
Consider the following relational schema:
Student(school-id,sch-roll-no,sname,saddress)
School(school-id,sch-name,sch-address,sch-phone)
Enrolment(school-id,sch-roll-no,erollno,examname)
ExamResult(erollno,examname,marks) 

Consider the following tuple relational calculus query.
{t∣∃E∈ Enrolment t=E .school-id ∧∣{x∣x∈ Enrolment ∧x. school-id =t∧(∃B∈ ExamResult B. erollno =x. erollno ∧B examname =x. examname ∧B. marks >35)}∣÷∣{x∣x∈ Enrolment ∧x. school-id =t}∣∗100>35}\begin{array}{l} \{t \mid \exists E \in \text { Enrolment } t=E \text { .school-id } \\ \wedge \mid\{x \mid x \in \text { Enrolment } \wedge x . \text { school-id }=t \wedge(\exists B \in \text { ExamResult } B . \text { erollno }=x . \text { erollno } \wedge B \\ \text { examname }=x . \text { examname } \wedge B . \text { marks }\gt 35)\}|\div|\{x \mid x \in \text { Enrolment } \wedge x . \text { school-id }=t\} \mid \\ * 100\gt 35\} \end{array}

If a student needs to score more than 35 marks to pass an exam, what does the query return?

Q17GATE 20082 marksMCQ−0.67 if wrong
Let R and S be two relations with the following schema

R (P‾,Q‾\underline{P},\underline{Q},R1,R2,R3)

S (P‾,Q‾\underline{P},\underline{Q},S1,S2)

Where {P, Q} is the key for both schemas. Which of the following queries are equivalent?

I. ΠP(R⋈S)\Pi _{P}(R\Join S)
II. Πp(R)⋈ΠP(S)\Pi _{p}(R)\Join \Pi _{P}(S)
III. ΠP(ΠP,Q(R)∩ΠP,Q(S))\Pi _{P}(\Pi _{P,Q}(R)\cap \Pi _{P,Q}(S))
IV. ΠP(ΠP,Q(R)−(ΠP,Q(R)−ΠP,Q(S)))\Pi _{P}(\Pi _{P,Q}(R)-(\Pi _{P,Q}(R)-\Pi _{P,Q}(S)))

Q18GATE 20071 markMCQ−0.33 if wrong
Consider the following relation schemas :
b-Schema = (b-name, b-city, assets)
a-Schema = (a-num, b-name, bal)
d-Schema = (c-name, a-number)
Let branch, account and depositor be respectively instances of the above schemas. Assume that account and depositor relations are much bigger than the branch relation.
Consider the following query:
Πc−name(σb−city="Agra"∧bal<0(branch⋈(account⋈depositor)))\Pi _{c-name}(\sigma _{b-city="Agra" \wedge bal \lt 0} (branch \Join (account \Join depositor)))
Which one of the following queries is the most efficient version of the above query ?

Q19GATE 20071 markMCQ−0.33 if wrong
Consider a selection of the form σA≤100(r)\sigma_{A\leq 100} (r), where r is a relation with 1000 tuples. Assume that the attribute values for A among the tuples are uniformly distributed in the interval [0, 500]. Which one of the following options is the best estimate of the number of tuples returned by the given selection query ?

Q20GATE 20071 markMCQ−0.33 if wrong
Information about a collection of students is given by the relation studinfo(studId‾\underline{studId}, name, sex). The relation enroll(studId, courseId) gives which student has enrolled for (or taken) what course(s). Assume that every course is taken by at least one male and at least one female student. What does the following relational algebra expression represent?
ΠcourseId((ΠstudId(σsex="female"(studInfo))×ΠcourseId(enroll))−enroll)\Pi_{\text{courseId}}\left(\left(\Pi_{\text{studId}}\left(\sigma_{\text{sex="female"}}(\text{studInfo})\right) \times \Pi_{\text{courseId}}(\text{enroll})\right) - \text{enroll}\right)

Keep practising

Topics in Databases

All CS topics ›