10. The computer-readable non-transitory storage medium of claim 9 , wherein the code further causes the processor to: maintain a mapping table from a first type of aggregate function and a second type of aggregate function to a type of composed aggregate function obtained by composing an aggregate function of the first type with an aggregate function of the second type; and wherein the new aggregate function is determined by looking up the mapping table.
9. The computer-readable non-transitory storage medium of claim 8 , wherein the code further causes the processor to: identify an inner aggregate function specified in the inner subquery and an outer aggregate function specified in the outer subquery; determine whether a result of the inner aggregate function is provided as an input to the outer aggregate function; responsive to determining that the result of the inner aggregate function is provided as the input to the outer aggregate function, determine a new aggregate function corresponding to a composition of the inner aggregate function and the outer aggregate function; and wherein the combined database query specifies the new aggregate function.