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

Home -> Community -> Usenet -> c.d.o.server -> Re: database design question

Re: database design question

From: Joseph D. Sumalbag <joseph_sumalbag_at_bose.com>
Date: 1997/10/28
Message-ID: <34563D94.2899@bose.com>#1/1

Ed Lufker wrote:
>
> Hi All:
>
> Here's the info I have, the first 7 digits
> of the account number field in file1 is the house number field in file2.
> The question is: would you set up a primary-foriegn key relationship or
> should I just load each file into a table in Oracle and just do joins
> when I need to get infomation out of the database.

Just a question , I don't know much about the system that you are designing ...... but is the house number really a good candidate for a key field ??????

What happens when the customer changed address ? What happens to the child records .

You have to cascade those changes to the database but before you can do that you have to disable the constraints which is most often discouraged.

 Maybe the ff criteria will help in selecting good candidate for key fields besides being unique and non nullable .

  1. Choose a field that will not change or get updated once created !
  2. Never choose a field that will hold relevant info other than being a "pointer" .
  3. As much as possible avoid using date as key fields (case to case exceptions) .... (a difference in a seconds doesn't produce a match ..... and a date field itself most often holds info that somebody might think of editing) .
  4. If no existing field falls in the above category ... what is stopping you in introducing one ... :-)

    Just a thought ...

-- 
================================================================
============================
| Joseph Sumalbag                                                                           
|
| Oracle DBA                                                                                
|
|                                                                                           
|
| The opinions expressed above are my own and doesn't 
 necessarily                           |
|reflect the opinion of any of my client company or my employer.                            
|
================================================================
============================
Received on Tue Oct 28 1997 - 00:00:00 CST

Original text of this message

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