Hi Guys, it's been a while
I have an interesting problem. I need to create a Coupon Definition table that I can use to solve various possible discount scenarios for my new cash register software. What is the most efficient schema that can handle the following discounts:
1) Buy x get y free (eg. buy 1 get 1 at equal or lower value).
2) Buy x get next y at z% of full price.
3) Buy group of x and get y extra ones free (0% of full price) but limit of z (x+y<=z)
4) Buy groups of x at y% of full price but limit of z.
So the question is, "Is there a way to represent this as one rule?" My last resort is to just have a column that defines the type of coupon being presented, but it would be nicer to create just one very flexible rule. Some of those are clearly the same rule just worded differently, but there is a clear difference between eg. 3 and 4. The later provides a discount on the first x purchased whereas the former requires that the first x be purchased at full price. Does this make sense? Vongrunt...save me! BTW, feel free to add other % scenarios that I haven't thought of. Let's not work on the $ off scenarios for now...that will be next!
-Karl
[red] Cursors, triggers, user-defined functions and dynamic SQL are an axis of evil![/red]
[green]Life's uncertain...eat dessert first...www.deerfieldbakery.com[/green]
1) Buy x get y free (eg. buy 1 get 1 at equal or lower value).
2) Buy x get next y at z% of full price.
3) Buy group of x and get y extra ones free (0% of full price) but limit of z (x+y<=z)
4) Buy groups of x at y% of full price but limit of z.
So the question is, "Is there a way to represent this as one rule?" My last resort is to just have a column that defines the type of coupon being presented, but it would be nicer to create just one very flexible rule. Some of those are clearly the same rule just worded differently, but there is a clear difference between eg. 3 and 4. The later provides a discount on the first x purchased whereas the former requires that the first x be purchased at full price. Does this make sense? Vongrunt...save me! BTW, feel free to add other % scenarios that I haven't thought of. Let's not work on the $ off scenarios for now...that will be next!
-Karl
[red] Cursors, triggers, user-defined functions and dynamic SQL are an axis of evil![/red]
[green]Life's uncertain...eat dessert first...www.deerfieldbakery.com[/green]