Quality Testing

Quality is delighting customers

What is the difference between Subquery and Corelated Subquery?

Give some examples of each

Views: 152

Reply to This

Replies to This Discussion

Co-related sub query : Co-related sub query is one in which inner query is evaluated only once and from that result outer query is evaluated.

Sub query : Sub query is one in which Inner query is evaluated for multiple times for gatting one row of that outer query.
Subquery: -
1. Required in those cases where requisted data are not known and always depend on inner query
2. In sub query the inner query is executed only once. Depeding upon the results of inner query , outer query is evaluated.

Correlated subquery: -
1. Outer depend on inner query and inner query depend on outer query
2. In correlated subquery the inner query is evaluated once for each row processed by the parent statement or outer query.
Sub Query : Inner most query is executed and the result is later processed by immediate parent.

Co-related Sub Query: Both the queries are executed simultaneously. i.e. output will be dependent on each other parent and child.

* Both can be used within the table and Master- Detail tables or different tables.


TTWT Magazine





© 2020   Created by Quality Testing.   Powered by

Badges  |  Report an Issue  |  Terms of Service