Re: newbie: using id's or total desciption

From: Bernard Peek <bap_at_shrdlu.com>
Date: Fri, 25 Apr 2003 13:58:01 +0100
Message-ID: <K07x8uiZDTq+EwD2_at_diamond9.demon.co.uk>


In message <b89n3o$f38$1_at_news.tu-darmstadt.de>, Mirko Koenig <koenig_at_v-i-t.de> writes

>> An invoice is a legal document and once it has been issued it can never
>> be changed. If you only include ID fields in the Invoice table then a
>> change in the related data would distort your invoice records. I would
>> always use the current values and not an ID. Remember to add the selling
>> price and tax to the sold_articles table.
>
>So how would you make statistics than?
>If i want a statistic about the volume of sale of one customer. What do i
>use? I have name1, name2, name3, street, zipcode, city as invoice data.
>But what to use for statistics.

Probably none of those. You need to look a lot more closely at the structure of the data. For instance do you have multiple delivery addresses for one customer, do you need to have separate statistics for each of them? Will you ever need to do that?

> If i change the name1 part of the
>customer data, but the customer istself is the same, i only made a
>spelling mistake, the statistic would be 'wrong' if i do it by counting
>on name1.
>
>If i use the id it can be wrong beacause the whole data can be changed.
>
>I agree with your opinion that a should store all beccessary data about
>the customer and the articles but how to do statistics.
>
>I think at this point i have to make an compromise or give the user a
>selection by what data he wants to make his statistics
>
>What do you think about This?

I think you should have already have asked the users what they want. It's their decision. When you have agreed the specifications for the system you can start coding.

-- 
Bernard Peek
bap_at_shrdlu.com
www.diversebooks.com: SF & Computing book reviews and more.....

In search of cognoscenti
Received on Fri Apr 25 2003 - 14:58:01 CEST

Original text of this message