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 > Database design question

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 01-29-04, 10:24
codergish codergish is offline
Registered User
 
Join Date: Jan 2004
Location: Canada
Posts: 6
Database design question

Hello, I am new here and I am going to jump righ into a design question and would like your suggestions/comments.

First of, the database is MySQL.

Here is the basic concept.
I have three tables that I am concerned about.

ContactType, Contacts, and Organizations

ContactType -> ID,Type,Description
Contacts -> ID,OrgID,FName,LName (etc)
Organizations -> ID,OrgName,OrgDesc

Now, I am not concerend in regards to that, but there is a situation that has come up where we may need another clients/contact table, so basically a "client" table and a "user" table, but there are times when the user is also a client. Is ther eany benifit to doing it this way...or should I just leave them in the structure I already have. I am not fond of the idea of have two tables that hold the same data just because they are temporary or not a client......

Please ask questions if I have been unclear, and I will reword my question....thanks again..

C
Reply With Quote
  #2 (permalink)  
Old 01-29-04, 12:12
N-ary N-ary is offline
Registered User
 
Join Date: Oct 2003
Posts: 87
Consider this: might a person belong to more than one org, be one type of contact in one org and another type in some other org? Might a contact be two different contact types belonging in the same org? Thus, you'll need an association table between contact and org with contact type related to it. And dump most of those IDs, use natural business PKs whenever you can.

contact (cntctID PK, fNm, lNm . . . )
organization (orgNm PK, orgDesc . . . )
contactType (cntctTyp PK, desc . . . )
contact_organization (cntctID PK FK, orgNm PK FK, cntctTyp PK FK)
__________________
Oracle - DB2 - MS Access -
Reply With Quote
  #3 (permalink)  
Old 01-29-04, 12:31
codergish codergish is offline
Registered User
 
Join Date: Jan 2004
Location: Canada
Posts: 6
good idea....thanks....
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