If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > General > Database Concepts & Design > normalization problem

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 11-07-11, 14:43
madmax_81 madmax_81 is offline
Registered User
 
Join Date: Nov 2011
Posts: 2
normalization problem

Hello!

I'm searching for a solution for the following problem. Maybe someone can help me.

Let's say I have 2 tables.

table invoice
id, customer_id, date, prize


table customer
id, name, street, zip, city

The problem is that if I change e.g. the name in the customer table the name is changed in all invoices that are already booked. That must not be. What is the best solution for that case? Should I create the name, street, zip and city columns into the invoice table too although it breaks the rules of normalization?

Thank's in advance!

Mad
Reply With Quote
  #2 (permalink)  
Old 11-07-11, 15:01
r937 r937 is offline
SQL Consultant
 
Join Date: Apr 2002
Location: Toronto, Canada
Posts: 19,524
Quote:
Originally Posted by madmax_81 View Post
Should I create the name, street, zip and city columns into the invoice table too although it breaks the rules of normalization?
yes you should and no it doesn't
__________________
r937.com | rudy.ca
please visit Simply SQL and buy my book
Reply With Quote
  #3 (permalink)  
Old 11-07-11, 15:22
Pat Phelan Pat Phelan is offline
Resident Curmudgeon
 
Join Date: Feb 2004
Location: In front of the computer
Posts: 12,605
Using GAAP terms, a bill is a record of a single transaction and an invoice is a document that is periodically issued to summarize one or more bills.

Both bills and invoices are statement documents, issued at a given point in time. Bills may be cash transactions, in which case there may not even be a customer name, address, etc. If there is information like name, address, etc provided for the bill or invoice then that information might be defaulted from the customer data or it could be provided by another means... In either case, the information used on the bill or invoice ought to be recorded as part of the record of the transaction instead of depending on the client table at any given point in time.

-PatP
__________________
In theory, theory and practice are identical. In practice, theory and practice are unrelated.
Reply With Quote
  #4 (permalink)  
Old 11-07-11, 16:23
madmax_81 madmax_81 is offline
Registered User
 
Join Date: Nov 2011
Posts: 2
Thank you for your answers!

Mad
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On