in Databases retagged by
390 views
0 votes
0 votes

Consider the relation schemas:

Rank (name, rank) and student (name, country), where name in student table is a foreign key in table Rank.

Which of the following TRC Queries displays all the student names from India along with their respective ranks?

  1. $\{ t \mid \exists q \in Rank ( q [name] = t [name] \wedge  t [rank] = q [rank] ) \wedge \exists p \in student (q [name] = p [name] \wedge q [country] = " India ") \}$
  2. $\{ t \mid \exists p \in Rank ( t [name] = p [name] \wedge t [rank] = p [rank] ) \wedge \exists q \in student (p [name] = q [name] \wedge p [country] = " India ") \}$
  3. $\{ t \mid \exists p \in Rank ( p [name] = t [name] \wedge  p [rank] = q [rank] ) \wedge  \exists q \in student (q [name] = p [name] \wedge q [country] = " India ") \}$
  4.  $\{ t \mid \exists p \in Rank ( t [name] = p [name] \wedge  t [rank] = p [rank] ) \wedge  \exists q \in student (q [name] = p [name] \wedge q [country] = " India ")\}$
in Databases retagged by
by
390 views

4 Comments

yes sir, now it is perfectly fine..
1
1

Option A specifies $p$ as the variable for $student$, but accesses the attribute $country$ with $q$.


Option B does the same — uses $p$ to access $country$, when it should've used $q$


Option C accesses $rank$ with $q$ — which is out of $q$'s bounds. Same as above two


2
2
Although it is not hard to guess but don’t you think that the variable “t” should have been explicitly associated with the table “Rank” to make the question more clear ?
0
0

1 Answer

4 votes
4 votes
Best answer

option D will be answer......

selected by

3 Comments

@akash.dinkar12 why not C??

0
0

@Jason

why u think C should be correct?

0
0
c will only print t.name, it will not print t.rank
0
0
Answer:

Related questions