in Databases recategorized by
1,342 views
5 votes
5 votes
Select      SNAME
from        S
Where       SNOin
            (select     SNO
            from        SP
            where       PNOin
                        (select     PNO
                        from        P
                        Where       COLOUR='BLUE'))

What relations are being used in the above SQL query? Given at least two attributes of each of these relations.

in Databases recategorized by
1.3k views

3 Answers

11 votes
11 votes
Best answer

There are $3$ relations here:

  • S(SNAME, SNO)
  • SP(SNO, PNO)
  • P(PNO, COLOUR)
edited by
0 votes
0 votes
relation S(sname , sno) and relation P(pno,colour)
0 votes
0 votes
S(SNAME , SNO)
SP(SNO , PNO)
P(PNO, COLOR)

SP is relation between S and P where sno and pno together being an primary key

Related questions