1. A computer program product for processing a structured query language (SQL) statement, the SQL statement comprising at least an OUTER JOIN operation, the computer program product comprising: one or more computer readable storage media and program instructions stored on the one or more computer readable storage media, the program instructions comprising program instructions to: determine whether a first query and a second query are equivalent, the first and second queries being respectively the left side and the right side operands of the OUTER JOIN operation; determine whether an output of the right side of the OUTER JOIN operation contains an output of the left side of the OUTER JOIN operation; determine whether partitioning columns of a GROUP BY operation are the same as partitioning columns of the OUTER JOIN operation; determine whether columns quantified by the right side of the OUTER JOIN operation include one or both of multiple distinct aggregation operations or multiple aggregation operations; determine whether there are no filter predicates or having clause in the GROUP BY operation; determine whether a SELECT output of the SQL statement does not refer to database columns from the left side of the OUTER JOIN operation which are not also partitioning columns of the OUTER JOIN operation; and responsive to determining that: (i) output of the first side of the OUTER JOIN operation contains the output of the left side of the OUTER JOIN operation, (ii) the partitioning columns of the GROUP BY operation are the same as the partitioning columns of the OUTER JOIN operation, (iii) the columns quantified by the right side of the OUTER JOIN operation include one or both of multiple distinct aggregation operations or multiple aggregation operations, (iv) there are no filter predicates or having clause in the GROUP BY operation, (v) the first query and the second query are equivalent, and (vi) the SELECT output of the SQL statement does not refer to database columns from the left side of the OUTER JOIN operation which are not also partitioning columns of the OUTER JOIN operation, transform the SQL statement into an optimized query SQL statement by removing the OUTER JOIN operation.