Related tables or Lookup tables ?

Posts   
 
    
omar avatar
omar
User
Posts: 569
Joined: 15-Oct-2004
# Posted on: 24-Mar-2005 14:47:04   

When do you consider a table to be a detail table or a lookup table? Example: InvoiceHeader, InvoiceDetail, Customer. InvoiceHeader (one-to-may) with InvioceDetail Customer (one-to-may) InvoiceHeader (invoiceHeader has a country column)

Is it an acceptable rule that I should always create PK-FK relations between any tables that need it irrespective..

JimFoye avatar
JimFoye
User
Posts: 656
Joined: 22-Jun-2004
# Posted on: 24-Mar-2005 18:02:24   

The terms "lookup table" and "detail table" are pretty semantically loose, and are useful insofar as they help to communicate something with a client. Most people understand "lookup table" to mean the data for a column will be coming from a separate table. You wouldn't use these terms in front of a relational purist, his ears would hurt from hearing them.

ALWAYS create PK-FK relationships when the tables are indeed "related".

omar avatar
omar
User
Posts: 569
Joined: 15-Oct-2004
# Posted on: 25-Mar-2005 18:45:09   

Thanx.. that really helped