Query grammar improved with aliases and subqueries.