This is probably a lot easier than I'm making it in my head right now but...
I just need a mathematical formula to calculate which products are most likely to be attractive to a customer based on other customer purchases.
Here's the scenario. When a customer adds a product to our shopping cart, I want to figure out what else he/she is most likely to buy based on past customer purchases.
So, let's say we have a table with three columns: CustomerID, ProductID, and OrderID . Given any single ProductID I want the following answers about OTHER ProductIDs (besides the one being analyzed):
A. The ProductID that was purchased the most on the most often on the same OrderID.
B. The ProductID that was purchased the most often of any future (>OrderID) order.
C. The ProductID that was purchased the most often on any order (current or past).
And, because I don't feel I'm making this clear, here's a concrete example:
If a customer adds apples to shopping cart. I want to know:
A. Besides apples, what other product did apple buying customers order the most at the same time they got apples.
B. Besides apples, after a customer purchased apples, what product did they most often order in the future.
C. Besides apples, when a customer purchased apples, what other product was also ordered by the same customer the most often.
Basically, I want to throw out a ProductID and get the top five answers for questions A, B, and C above.
## Deliverables
The deliverables on this one can be a MS SQL server query based on the database described above or an ASP/vbscript that answers each of the questions above. The deliverable will need to accurately answer A, B, and C above with the top five answers for each. The final database to be analyzed will have millions of rows of data so the solution needs to handle that fairly rapidly/efficiently.
## Platform
asp, MS sql