Write SQL statements that use aggregation and filtering