Re: newbie: using id's or total desciption

From: Mirko Koenig <koenig_at_v-i-t.de>
Date: Fri, 25 Apr 2003 00:05:44 +0200
Message-ID: <b89n3o$f38$1_at_news.tu-darmstadt.de>


On Thu, 24 Apr 2003 19:28:56 +0200, Bernard Peek wrote:

> In message <b8928o$91s$1_at_news.tu-darmstadt.de>, Mirko Koenig
> <koenig_at_v-i-t.de> writes
>
>>I'm planing a database for sales managment in a little shop. I have a
>>table for all articles and one for all customers. Than one for all
>>invoices and one for all sold articles.
>>
>>The one with the invoices hold every data of a invoice without the
>>artciles of the invoice. These articles are saved in the table
>>sold_articles with the invoice id.
>>
>>My question is:
>>
>>If i save an invoice, should i save only the id of the customer the
>>invoice goes to or should i save the customers name and address instead
>>of the id?
>
> 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. 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?

Mirk Koenig Received on Fri Apr 25 2003 - 00:05:44 CEST

Original text of this message