Exams › GATE › Technical
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 (R registration ⋈ Students))
(III) { T | ∃S Students ∧ ∃R Registration ∧ (R.courseno=107 ∧ R.percent>90 ∧ T.sname=S.sname)}
(IV) {<Sₙ> | ∃S, R, p (<S, Sₙ>∈Students ∧ <S, 107, R, p>∈Registration ∧ R > 90)}
- I, II, III and IV
- I, II and III only
- I, II and IV only
- II, III and IV only
Correct answer: I, II, III and IV
Solution
All four options accurately express the requirement to find distinct student names who scored above 90% in course 107, using different representations of relational algebra and SQL, thus confirming their equivalence.
Related GATE Technical questions
⚔️ Practice GATE Technical free + battle 1v1 →