Multiple choice

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) $ \prod_{sname}(σ_{courseno=107 ∧ percent > 90} (Registration ⋈ Students)) $

(III) $\left\{T \mid ∃S \in Students, ∃R \in Registration ( S.rollno=R.rollno \land R.courseno=107 ∧ R.percent>90 ∧T.sname=S.sname)\right \}$

(IV) $\left\{ \langle S_N\rangle \mid ∃S_R∃R_P (\langle S_R,S_N\rangle ∈Students ∧ \ \langle S_R,107,R_P\rangle ∈Registration ∧ R_P>90) \right\}$

  1. I, II, III and IV

  2. I, II and III only

  3. I, II and IV only

  4. II, III and IV only

Reveal answer Fill a bubble to check yourself
A Correct answer
Explanation

Four queries given in SQL, RA, TRC and DRC in four statements respectively retrieve the required information.