Effective Dating Series Part I - The Problem

  • Comments posted to this topic are about the item Effective Dating Series Part I - The Problem

  • Hi.

    I read the very interesting Article. But i have a little question... Why don't we implement the 2 dates into the promotion table instep off the promoted products? In this way we could not replicate the same dates for every product...

    It could be a good idea or not? And if not, could you explain me the reason?

    Thank you very much

    Bye

    Mauro

  • I'm inclined to agree with Mauro - to me it makes more sense to have the Promotion start and end date in the Promotions table, not the PromotedProducts table.

    That then leaves the PP table design in a simpler state when you're asked to implement multiple pricings on the same product (i.e Buy 2 get 1 free OR Buy 6 get 4 free. Marketing departments do come up with this insanity!) which DO belong in the PP table.

    This would also make your reporting easier, I think.

    Well written article though, very easy to read and 100% clear in its delivery.

  • Why not just have a mathematical price modifier attached to the promotions table rather than a promotion price - that way you can apply a promotion to a group of products without having to set up a load of new prices, this makes applying and unapplying promotions a hell of a lot easier regardless of whether you're using an expiry date or not.

  • Arguably you could have the start/end dates at both levels! It really depends on the strategy you organisation takes. You might decide to have a particular promotion running for a finite period and then subsequently change the products that are included in that promotion. As you said Stephen, marketing departments come up with the most outlandish strategies some times.

    I've been using temporal database design for a few years no and there's no question that it makes life easier down the track. I picked it up from a book 'The Data Model Resource Book' by Len Silverston which is well worth a read for any budding data modelers.

  • For sure, Temporal design can save many many headaches down the line.

    A system I recently worked on had a very nice facility in addition to temporal data attached to the promotions and that was the ability to define how the pricing was done during the promotion- either a simple price change, a list of volume discounts, or a mathematical function.

  • Good Article- seems like a pretty simple concept, have used it many times in the past.

  • When I've done this before, I've kept the dates in the promotions table. I called it a "PricingScheme" table, since it included other things that just special promotions, but it's the same concept.

    I have to mention that seeing the title of this article made me wonder if SSC had changed into a different type of website overnight. 😉

    - Gus "GSquared", RSVP, OODA, MAP, NMVP, FAQ, SAT, SQL, DNA, RNA, UOI, IOU, AM, PM, AD, BC, BCE, USA, UN, CF, ROFL, LOL, ETC
    Property of The Thread

    "Nobody knows the age of the human race, but everyone agrees it's old enough to know better." - Anon

  • Great aticle! I've been trying to get this concept across to the developers of an accounting package that I work with. Managing changes in price lists (never mind promotional items) can be a bear. This process would simplify so many things for the end users. Being able to import "next week's price list" would be a great feature.

    I would also consider using the date associated with the document header to locate these promo items instead of a system date. There will be cases where you have to back date a transaction and using the document's date vs. the system date will allow that.

  • Agreed with RobertM, there is a place for dates in both tables depending on the business strategy. Imagine if you had the same promotion with a rolling list of products to be discounted (e.g. the "Two for One" promotion that lasts all summer long, but which features a new/different product every week).

    As to the person wondering about discount rates, there are pros and cons to that. The pro, as mentioned, is not maintaining a separate list of hard prices. The immediately obvious con is figuring out later, say 6-mos down the road, when products prices' may have changed, just how much that product cost under that promotion.

  • You said "heinous"

    :hehe:

  • Mod -1, how is this article supposed to help me get a date?!

    ---------------------------------------------------------
    How best to post your question[/url]
    How to post performance problems[/url]
    Tally Table:What it is and how it replaces a loop[/url]

    "stewsterl 80804 (10/16/2009)I guess when you stop and try to understand the solution provided you not only learn, but save yourself some headaches when you need to make any slight changes."

  • jcrawf02 (10/1/2009)


    Mod -1, how is this article supposed to help me get a date?!

    Read the title - "Part 1 - The Problem". It's a demonstration - you read the article and commented on an SQL forum. Case in point. Hopefully next week there'll be a cure for this kind of behaviour, or at least how to effectively hide it from the opposite sex.:-P

  • Thinking about where to put the dates:

    I'm not sure if this is better or just over-engineering, but what about a PromotionInstance (PI) table between Promotion (P) and PromotionProduct (PP) with the start and end dates in PI.

    Either give PI its own ID, e.g. PromotionInstanceID, that can be part of the PP PK (instead of the PromotionID), or have the Start and End dates be part of the PI PK and have the PP table look as it does in the article.

    The advantages I see are small, but here they are:

    - You can have a recurring promotion described in P ("Semi-Annual Sale"), then have the specific occurrence's details in PI ("Fall 2009 Back To School Sale") and the products are strongly coupled to a real-life event.

    - A better level of normal form by having the PP dates either as FK to PI or by eliminating them from PP in favor of a PI ID. This makes me more comfortable in with data integrity, though I can see the argument that it's safe enough if the dates in PP are system-managed.

    Promotions that only ever occur once would just have one instance, of course.

  • dan-579597 (10/1/2009)


    Thinking about where to put the dates:

    I'm not sure if this is better or just over-engineering, but what about a PromotionInstance (PI) table between Promotion (P) and PromotionProduct (PP) with the start and end dates in PI.

    Either give PI its own ID, e.g. PromotionInstanceID, that can be part of the PP PK (instead of the PromotionID), or have the Start and End dates be part of the PI PK and have the PP table look as it does in the article.

    The advantages I see are small, but here they are:

    - You can have a recurring promotion described in P ("Semi-Annual Sale"), then have the specific occurrence's details in PI ("Fall 2009 Back To School Sale") and the products are strongly coupled to a real-life event.

    - A better level of normal form by having the PP dates either as FK to PI or by eliminating them from PP in favor of a PI ID. This makes me more comfortable in with data integrity, though I can see the argument that it's safe enough if the dates in PP are system-managed.

    Promotions that only ever occur once would just have one instance, of course.

    Would you ever need to treat the multiple occurrences of a sale like your 'semi-annual sale' as one object? If not, I'd think this is overkill, as each occurrence would be treated and analyzed as a separate animal.

    ---------------------------------------------------------
    How best to post your question[/url]
    How to post performance problems[/url]
    Tally Table:What it is and how it replaces a loop[/url]

    "stewsterl 80804 (10/16/2009)I guess when you stop and try to understand the solution provided you not only learn, but save yourself some headaches when you need to make any slight changes."

Viewing 15 posts - 1 through 15 (of 46 total)

You must be logged in to reply to this topic. Login to reply