I am trying to write a SQL query for Magento that will show orders which were paid (non-zero total) and those which were coupon based (zero total). The Coupon-based orders should be divided by the promotion that the coupon was from. Then each row of the report show the following:
- The promo name (Shopping cart price rule name)
- Number of orders
- Percentage of total orders
- Average order total
I realize this is could be an extremely complex query, so would be happy with someone pointing out the table(s) that I will need in order to execute this. Any an all help is welcome and thanked =)