Abstract: A computer automated technique for rewriting SQL with table subqueries into more optimal table expression equivalents without derived tables. The context of the table subqueries, including any join and filter predicates are moved to the encompassing outer query. The advantage of this technique is to provide optimized source SQL to the relational database optimizers.