GateAI
Relational Model and SQL

GATE CSE 2013 · Q35

MCQ2 marksEasy

Time

Consider the following relational schema. Students(rollno: integer‾, sname: string)\text{Students}(\underline{\text{rollno: integer}}, \text{ sname: string}) Courses(courseno: integer‾, cname: string)\text{Courses}(\underline{\text{courseno: integer}}, \text{ cname: string}) Registration(rollno: integer‾,courseno: integer‾, percent: real)\text{Registration}(\underline{\text{rollno: integer}}, \underline{\text{courseno: integer}}, \text{ percent: real}) Which of the following queries are equivalent to this query in English? “Find the distinct names of all students who score more than 90% in the course numbered 107” (I) SELECT DISTINCT S.snameFROM Students as S, Registration as RWHERE R.rollno=S.rollno AND R.courseno=107 AND R.percent >90 (II) Πsname(σcourseno=107∧percent>90(Registration⋈Students))\Pi_{\text{sname}}(\sigma_{\text{courseno}=107 \wedge \text{percent}>90} (\text{Registration} \bowtie \text{Students})) (III) {T∣∃S∈Students,∃R∈Registration (S.rollno=R.rollno∧R.courseno=107∧R.percent>90∧T.sname=S.sname)}\{ \text{T} \mid \exists \text{S} \in \text{Students}, \exists \text{R} \in \text{Registration} \ ( \text{S.rollno}=\text{R.rollno} \wedge \text{R.courseno}=107 \wedge \text{R.percent}>90 \wedge \text{T.sname}=\text{S.sname})\} (IV) {⟨SN⟩∣∃SR∃RP (⟨SR,SN⟩∈Students∧⟨SR,107,RP⟩∈Registration∧RP>90)}\{ \langle \text{S}_\text{N} \rangle \mid \exists \text{S}_\text{R} \exists \text{R}_\text{P} \ ( \langle \text{S}_\text{R}, \text{S}_\text{N} \rangle \in \text{Students} \wedge \langle \text{S}_\text{R}, 107, \text{R}_\text{P} \rangle \in \text{Registration} \wedge \text{R}_\text{P} > 90)\}

Select one answerSingle correct

Pick an option to check

Solution

Step-by-step verified solution

Official answer: A) I, II, III and IV

Relational Model and SQL

Let us evaluate all four given query representations:

  1. Query (I) (SQL): Performs a join of Students and Registration on rollno, filters records having courseno = 107 and percent > 90, and projects unique sname using SELECT DISTINCT. Hence, it correctly matches the English query.

  2. Query (II) (Relational Algebra): Performs a natural join Registration⋈Students\text{Registration} \bowtie \text{Students} on the common attribute rollno, applies the selection σcourseno=107∧percent>90\sigma_{\text{courseno}=107 \wedge \text{percent}>90}, and projects Πsname\Pi_{\text{sname}}. By definition of set semantics in relational algebra, projection eliminates duplicates. Thus, this is equivalent.

  3. Query (III) (Tuple Relational Calculus - TRC): Selects tuple TT containing sname such that there exist tuples S∈StudentsS \in \text{Students} and R∈RegistrationR \in \text{Registration} satisfying S.rollno=R.rollnoS.\text{rollno} = R.\text{rollno}, R.courseno=107R.\text{courseno} = 107, R.percent>90R.\text{percent} > 90, and T.sname=S.snameT.\text{sname} = S.\text{sname}. Since TRC operates on sets, it returns distinct student names.

  4. Query (IV) (Domain Relational Calculus - DRC): Expresses domain variable ⟨SN⟩\langle \text{S}_\text{N} \rangle such that there exist SR\text{S}_\text{R} and RP\text{R}_\text{P} with ⟨SR,SN⟩∈Students\langle \text{S}_\text{R}, \text{S}_\text{N} \rangle \in \text{Students} and ⟨SR,107,RP⟩∈Registration\langle \text{S}_\text{R}, 107, \text{R}_\text{P} \rangle \in \text{Registration} with RP>90\text{R}_\text{P} > 90. This also correctly returns the set of distinct student names.

Therefore, all four queries (I), (II), (III), and (IV) are equivalent. The correct option is (A).

Try the question first, then check your work.

Think the official key or this write-up is wrong?

Report error or challenge

Examiner trap

The misconception this question tests

This Relational Model and SQL previous year question is Q35 of the GATE CSE 2013 paper. Find more GATE CSE PYQs on Relational Model and SQL in Databases, or browse all GATE CSE PYQs.

Free diagnostic

Where do you stand for GATE?

Take the 20-minute diagnostic: the 3 topics that cost you the most marks, and a rank range. Or sit 5 related Relational Model and SQL PYQs now with no account.

One GATE CSE PYQ every morning

An official question by email at 7 AM IST, with a link to its verified solution. Unsubscribe in one click.

Relational Model and SQL in GATE CSE

Relational Model and SQL has 15 GATE CSE PYQs across 12 papers from 2011 to 2026. 8 of them are 2-mark MCQs like this one, and GATE CSE 2013 has 2.

How GATE tests Relational Model and SQL

More from GATE CSE 2013

Share this solution

A plain-text card for WhatsApp or Telegram study groups.

GateAI solution cardGATE CSE 2013 · Q35 · MCQ

Consider the following relational schema. Students( rollno: integer, sname: string) Courses( courseno: integer, cname: string) Registration( rollno: integer, courseno: integer, percent: real) Which of the following queries are equivalent to this query in English? “Find the distinct names of all students who score more than 90% in the course numbered 107” (I) SELECT DISTINCT S.sname FROM Students as S, Registration as R WHERE R.rollno=S.rollno AND R.courseno=107 AND R.percent >90 (II) sname( courseno=107 percent>90 (Registration Students)) (III) { T ∃ S ∈ Students, ∃ R ∈ Registration ( S.rollno=R.rollno R.courseno=107 R.percent>90 T.sname=S.sname)} (IV) \({ SN ∃ SR ∃ RP ( SR, SN ∈ Students SR, 107, RP ∈ Registration RP > 90)} )

Topic-wise GATE CS PYQs with verified steps

Independent practice explanation verified by the GateAI team. GATE is conducted by the IITs; question text follows the official paper.