Using MS Access SQL View to pose and execute the following queries:
Q1: Retrieve all the orders with a purchase amount of at least $300 and after September 2012.
Q2: Retrieve all the distinct pairs of customer ID and salesman ID.
Q3: For each customer, retrieve the customer ID and the sum of purchase amounts of the orders by the customer.
Q4: For each customer, retrieve the customer ID and his/her number of orders with a purchase amount greater than $200.
Q5: Consider groups of orders where each order has the same customer and salesman and is before October 2012. For each such group without any purchase amount less than $100, retrieve the customer ID, salesman ID, number of orders, minimum purchase amount, and average purchase amount.
ord_no purch_amt ord_date customer_id salesman_id
70001 70009 70002 70004 70007
70005 70008 70012 70011 70013
150.5 270.65 65.26 110.5 948.5
2400.6 5760 250.45 75.29 3045.6
2012-10-05 2012-09-10 2012-10-05 2012-08-17 2012-09-10
2012-07-27 2012-09-10 2012-06-27 2012-08-17 2012-04-25
3005 3001 3002 3009 3005
3007 3002 3008 3003 3002
5002 5005 5001 5003 5002
5001 5001 5002 5007 5001