Click here to Skip to main content
16,016,770 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Can somebody explain how can i design a discount table for my products ( in an online shopping project ). Currently i have following fields............

1 offer-id
2 product-id
3 offer-title
4 offer-description
5 discount_value
6 date-added
7 start-date
8 expiry-date
9 status

Suppose i want to give discount on a particular category of products or if shopping amount is greater than a specific amount, how can i store it in my table. Please help........
Posted
Comments
joshrduncan2012 18-Jun-13 9:08am    
What have you tried so far?
Himu from Orissa 18-Jun-13 9:16am    
Actually i can not find a way to design the table
RedDk 18-Jun-13 12:44pm    
Two links which will help immensely:

1. http://www.microsoft.com/en-us/download/details.aspx?id=1842
2. http://msdn.microsoft.com/en-us/library/ms130214(sql.100).aspx

All you need to know to do whatever you want to do.
Himu from Orissa 19-Jun-13 8:38am    
Whats there in the links??????
RedDk 21-Jun-13 18:34pm    
Well for one thing, the word "detail" ... Let's start there guy.

1 solution

You would need to have categories in your database. Then you could add a category id and allow for the product id to be null or the category id to be null, so it supports both. Or, I would do it differently again. I'd have a table that has fields 1 and 3-9 in your list. Then I'd have a table joining offer id to product id and another table to join offer id to category id. This assumes the discount is a % off, if it's a hard value, then you need an entry per product no matter what, obviously.
 
Share this answer
 
Comments
Himu from Orissa 19-Jun-13 8:42am    
but how can i store the conditions e.g. if total shopping amount is greater than 5000
Christian Graus 19-Jun-13 16:16pm    
You would calculate things like that, not store them

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900