Consider the following relational schema.
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”
SELECT DISTINCT S.sname FROM Students as S, Registration as R WHERE R.rollno=S.rollno AND R.courseno=107 AND R.percent >90
beautiful qestion to apply it all
TRC and DRC -> https://www.w3schools.in/dbms/relational-calculus/
I think in third part. $T∈Students$ is missing. Ideally it should be -
$ \left \{ T ∣ T∈Students ∧ ∃S∈Students,∃R∈Registration(S.rollno=R.rollno∧R.courseno=107∧ R.percent>90∧T.sname=S.sname) \right \}$
Refer - https://gateoverflow.in/1331/gate2009-45
it is not necessary according to this image
Why not T.sname in 3rd option? It is causing hell a lot of confusion. In every other TRC question the attribute to be printed is given in LHS of |.
but how is the tuple caculus query correct it prints the whole tupple but it is asked to print only student name to it should be
{T.sname∣∃S∈Students,∃R∈Registration(S.rollno=R.rollno∧R.courseno=107∧R.percent>90∧T.sname=S.sname)}
@hkara That's not how tuple relation calculus defines tuple selection. You can see here:
https://en.wikipedia.org/wiki/Tuple_relational_calculus
∏_{sname}(σ_{courseno}_{=107∧percent>90}(Registration⋈Students))
Here there is no joining condition like Registeration.rollno=Students.rollno is given
@rahul sharma 5
yes , TRC and DRC returns distinct results . https://www.geeksforgeeks.org/gate-gate-cs-2013-question-35/
If you find it is wrong please reply , i also had same doubt
Gatecse