Created SubQueryBuilder for defining subquery.

fix for review comments.