In thread thread183-1094475, vongrunt outlined a Coupon Definition table to be used by a program running a cash register. The next hurdle involving the Coupon Definition table is actually its child table which contains the ProductIDs to which a coupon can be applied. For example a coupon might allow 20% off the purchase of any assortment of various sweet rolls. So the child table would consist of the CouponID and a ProductID - one row for each ProductID.
The problem is that a coupon can provide for a 20% discount on any purchase. I don't want to create a row in the child table for every item in the Product Table. What's the best way to keep the SQL simple when determining which items purchased by a customer apply to this coupon?
-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]
The problem is that a coupon can provide for a 20% discount on any purchase. I don't want to create a row in the child table for every item in the Product Table. What's the best way to keep the SQL simple when determining which items purchased by a customer apply to this coupon?
-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]