I have tables on my database with schema:
customers (customerID: integer, fName: string, lName: string)
items (itemID: integer, description: string, price: integer)
orders (orderID: integer, itemID: integer, aID: integer, customerID: integer, date: date)
For each customer, I would like to return the customerID, the number of orders and the average amount of money the customer spent during March 2013 (Total spending for each customer/order in March) this includes ALL customers regardless of whether they actually bought something in March or not.
I have tried using join and other functions but have not been successful. Any help would be appreciated. Thanks!