Adding the 'SELECT FROM WHERE with two implied joins, a MAX function, an AVG function, and at least two levels of parentheses embedding in the where clause (i.e., a very non-trivial where clause)' query