added order by
added aggregate functions
added group by