>When it comes to good normalization practice, is it better to not denormalize when attempting to store aggregate data? For example, what are the implications of deciding whether or not to have a "YTD purchased field" in a customer table? I've read that the decision to include this type of aggregate field is based on the need for speed, and therefore may necessitate including it in the customer table. I would like to hear some comments regarding this.
>
>FYI, thread #
130522 was helpful with regards to some other normalization questions if anyone is interested.
Jim,
Storing the YTDSales in the customer table is a violation of third normal form in that the value is not solely dependent on the primary key of the cutsomer table, it is codependent on the values in other tables.
As to whether or not to use the field in the customer table, well that is a judgement call. Which way makes the system function as it should?
Regardless as to whether the YTD Sales figure appears in the customer table or not, the source of the calculation should be the value that is consideredn as the correct one in the case of any discrepancy. The YTDSales field should only be used for the express purpose that you put it there for and for nothing else.