subqueries by semi-join like techniques 21 22 . Likewise thre problem of flattening queries containing views has been a topic of interest. The case where participating views are SPJ queries is well understood. The problem is more complex when one or more of the views contain aggregation 23. Naturally, this problem is closely related to the problem of commuting group-by and join operators. However, commuting groip-by and join is applicable in the context of single block SQL queries as well 24 25 26 An overviews of the field appears in a recent paper27.