Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> comp.databases.theory -> Re: newbie: using id's or total desciption

Re: newbie: using id's or total desciption

From: Bernard Peek <bap_at_shrdlu.com>
Date: Thu, 24 Apr 2003 18:28:56 +0100
Message-ID: <287+++KY7Bq+Ewkf@diamond9.demon.co.uk>


In message <b8928o$91s$1_at_news.tu-darmstadt.de>, Mirko Koenig <koenig_at_v-i-t.de> writes
>Hi
>
>(english is not my mother tongue)
>
>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.

I would also add the total invoice value to the Invoice table. That means that you don't need to use the sold_articles table to calculate your sales revenues.

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

In search of cognoscenti
Received on Thu Apr 24 2003 - 12:28:56 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US