In chapter 25 of The Essence of SQL, Dr. Rozenshtein says, "Given a query tree, it is prohibited to use aggregate functions and/or the GROUP BY or HAVING c