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 > What kinds of relationships to use?

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 05-29-09, 10:40
RetraRoyale RetraRoyale is offline
Registered User
 
Join Date: May 2009
Posts: 5
Question What kinds of relationships to use?

I have a database with two related tables: tblPersonnel (One) and tblPositions (Many). The problem is this: I want to add information about a person's qualifications for the position to the database. I can't add it to the Personnel table, because it depends on what position they fill, and I can't add it to the positions table, because it doesn't update consistantly (If you remove a person from the position, the qualification data stays...)

What I want is when you delete a personnel record or remove a person from a position, the qualification data will evaporate. (And maybe be reinserted by some code, but I would rather have empty data that needs to be updated then wrong data that is just leftover from earlier changes.) Is there any way to do this in the database, or do I have to do it with triggered code?

Last edited by RetraRoyale; 05-29-09 at 10:45.
Reply With Quote
  #2 (permalink)  
Old 05-29-09, 11:02
healdem healdem is offline
Jaded Developer
 
Join Date: Nov 2004
Location: out on a limb
Posts: 9,246
the persons qualifications are an attribute of the person, not the position they hold. there may be a constraint that says anyone in position XYZ must be educated to undergraduate level, but that is a function of the position, as presumably someone educated to postgraduate level also qualifies for that position.
I would have expected a FK in the personnel table to point to either your positions table, or an intersection table which associates a person with a position type
position type could identify say porjcet managers, developers, dba's, qc, front line support etc. and there is an iontermediater tables which associates a specific person with a specific role

however it may be that postions is an inersection table (recording the fact that, say, RetraRoyale is a developer, appointed on x date

its relatively rare to come accross a genuine many to many table design (at logical level yes, but not at physical level.
__________________
I'd rather be riding my Versys or my Tiger 800 let alone the Norton
Reply With Quote
  #3 (permalink)  
Old 05-29-09, 11:20
RetraRoyale RetraRoyale is offline
Registered User
 
Join Date: May 2009
Posts: 5
Well, I was partially thinking like that. I have another table to keep track of a person's education and training, but I can't really constrain the data in a way that's compatable with the position table. (That is, the education and training data is to be treated as independent of the qualification for the position. Also, education information is kept for a different reason.)

We will have to be able to assign someone as qualified for a position, even if we have no record of their education and training. I just need to be able to justify it outside of their education data. Also, I'm not thinking of it as "a person holds these qualifications (or qualifications for these certain positions)" because the positions are too flexible and unique. Actually, positions are records in the position table, which draws data from multiple sources (Document, department, etc...)

Actually, it might be better to think of qualification data as temporary. That's why I need it to go away easily.
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