I am building an ecommerce site and would like to offer discounts on certain items for a limited time.
My Product table (MySQL) looks like this:
Product -
Another thing to consider would be, how do you model situation when there is no discount for a given item? You might use a Null Object pattern here - basically, when a product is created, you also add a deal on that product with 0% discount and unlimited time. That way, you could simplify your product retrieval logic (no outer joins in query, no if
for calculating price).