retagged by
1,423 views

1 Answer

3 3 votes

It is an example of nested query with correlation .Following are the 3 salient features of nested query with correlation :

a) Outer query uses the result of inner query

b) Inner query uses the attributes mentioned in outer query

c) So for each  instance of outer query is used and compared with every tuple resulting in the subquery..So the execution sequence is in zigzag manner.

Such nested queries are used generally with EXISTS , NOT EXISTS clauses..

So in the given query  we see for a given value of A attribute of R which is in outer query , it is compared with every attribute value D of relation S in the inner query(or subquery) ..

So for 1 attribute instance of A , inner query will execute once and then we will have those tuples where A = D is satisfied

So total number of times inner query is executed            = No of values of A(or tuples of R)  

                                                                                  =  10  

                                          

Hence B) should be the correct option. 

edited by
Position:
Show:

Related questions

0 0 votes
2 2 answers
1.1k
1.1k views
Devasish Ghosh asked Mar 2, 2017
1,112 views
Commodity items have some positive or negative changes in theirprices each week. Each trading company picks a portfolio of com-modity items, that is, they have one or mor...
1 1 vote
2 2 answers
987
987 views
Purple asked Jan 9, 2017
987 views
Consider the following instances $R.$A1234BNull122The number of tuples returned by the following $\text{SQL query}$ is$?$$>$select $*$ from $R$ as $R_{1}$ where not exist...
3 3 votes
2 answers 2 answers
1.3k
1.3k views
reena_kandari asked Nov 8, 2016
1,310 views
1 1 vote
1 1 answer
1.2k
1.2k views
sh!va asked Jul 15, 2016
1,216 views
Spot the wrong statement.Subschema is related with external view only.Data dictionary is a tool used exclusively by the database administrator.To define a schema DDL, DML...