GATE CS 2013 · Question 35 · Databases · Multiple choice (MCQ) · 2 marks · −2/3 for a wrong answer
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) Πₛₙₐₘₑ(σ_(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) {⟨ S_N ⟩ | ∃ S_R ∃ R_P (⟨ S_R, S_N ⟩ ∈ Students ∧ ⟨ S_R, 107, R_P ⟩ ∈ Registration ∧ R_P>90)}
- (A) I, II, III and IV
- (B) I, II and III only
- (C) I, II and IV only
- (D) II, III and IV only
Answer
Answer (A)
Answer from the official GATE CS 2013 answer key.
The step-by-step solution, where available, is part of GATE CS Pro. See what Pro includes