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 > Key problems with tables

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 12-05-05, 14:05
JimmyFo JimmyFo is offline
Registered User
 
Join Date: Dec 2005
Posts: 6
Key problems with tables

Hi, I am new to databases and I'm having some trouble. I've attached a diagram so you can see what I'm talking about:

http://i20.photobucket.com/albums/b2...o/database.jpg

What I'm trying to do is create a database with employees, their certifications, the organizations the certifications come from, and so on. One employee can have many certifications, one certification can be held by many employees, etc. I've done some searching online and I'm confused - do I need seperate tables to hold these relationships? Don't keys point to tables (i.e. that the empID FK in the certification table points to a number of employees?).

Say I want to start simpler, just employee and certification: name of employee in one and certification name in the other. How can I set up many to many relationships between them, so that I can look up the employee and come up with all the certs held by him?

Thanks,
James
Reply With Quote
  #2 (permalink)  
Old 12-05-05, 14:32
Teddy Teddy is offline
Purveyor of Discontent
 
Join Date: Mar 2003
Location: The Bottom of The Barrel
Posts: 6,075
You're thinking too hard. What does a certification consist of? Well, a title, a governing organization and perhaps a description? What does an employee consist of? An employee id, basic name/contact information and perhaps a title. How do you put those together? EmployeeCertifications, containing a certification id and an employee id.
__________________
oh yeah... documentation... I have heard of that.

*** What Do You Want In The MS Access Forum? ***
Reply With Quote
  #3 (permalink)  
Old 12-05-05, 15:03
JimmyFo JimmyFo is offline
Registered User
 
Join Date: Dec 2005
Posts: 6
Well that makes sense, but I believe that I would need an entire table of certifications. Well, maybe not. This is to be backend to an application, and the user needs to select the certification from a dropdown I would be calling from a database, the certification table. So maybe keep an entirely seperate table for all certifications on record, then copy that certification to a field for the employee?

Here's the thing though - I want to search by employee, certification, or organization, or any combination. So I think at the very least, the certification table and organization table would need to be related, right? So I can say that Microsoft points to MCSE/MCSD/etc and IBM to WebSphere/Modeler/etc, and the certificates should point back to the organization that gives them. Or just a table with all certs and a field with the company?

If I searched by user "James F" and organization "IBM" I want all IBM certs that I have.

I'm new to database construction, and the help I find is over my head to a certain extent. Maybe seperate tables then just compare the values?

I want to make this database clear, easy to maintain and upgrade, and fast and well thought out. That's why all the debating! I haven't designed one before

Thanks,
James

Last edited by JimmyFo; 12-05-05 at 15:06.
Reply With Quote
  #4 (permalink)  
Old 12-05-05, 15:40
Teddy Teddy is offline
Purveyor of Discontent
 
Join Date: Mar 2003
Location: The Bottom of The Barrel
Posts: 6,075
What you described can be done with four tables: Employee, certification, organization and employeecertification

Take a crack at figuring out how to link 'em up...
__________________
oh yeah... documentation... I have heard of that.

*** What Do You Want In The MS Access Forum? ***
Reply With Quote
  #5 (permalink)  
Old 12-05-05, 16:24
JimmyFo JimmyFo is offline
Registered User
 
Join Date: Dec 2005
Posts: 6
Teddy, here's what I've come up with.
Ignore the other tables, they are just exercises in the same fashion

Thanks for your help,
James
Attached Images
File Type: jpg database.jpg (426.4 KB, 64 views)
Reply With Quote
  #6 (permalink)  
Old 12-05-05, 16:29
JimmyFo JimmyFo is offline
Registered User
 
Join Date: Dec 2005
Posts: 6
Oh, and if that's right, if I want to have a new employee, a new certification, and a relationship between them, what do I change? I assume I create the new employee, the new certification - but then the foreign and primary keys in the Emp_Cert table... are they set automatically?
Reply With Quote
  #7 (permalink)  
Old 12-05-05, 16:41
Teddy Teddy is offline
Purveyor of Discontent
 
Join Date: Mar 2003
Location: The Bottom of The Barrel
Posts: 6,075
Looks good to me, barring all those exam tables of course.

I'm not sure I understand your question with regard to new employees and certifications.
__________________
oh yeah... documentation... I have heard of that.

*** What Do You Want In The MS Access Forum? ***
Reply With Quote
  #8 (permalink)  
Old 12-05-05, 16:49
JimmyFo JimmyFo is offline
Registered User
 
Join Date: Dec 2005
Posts: 6
I'm just confused as to how the relationship table works. For each employee/certification relationship, do I need a unique identifier in the Emp_Cert table? So if Employee A has 10 certificates, there are ten rows in the Emp_Cert table, each with a unique id and pointing to the respective certifications and employee? That would, I assume, be the table I search.

Thanks,
James
Reply With Quote
  #9 (permalink)  
Old 12-05-05, 17:05
Teddy Teddy is offline
Purveyor of Discontent
 
Join Date: Mar 2003
Location: The Bottom of The Barrel
Posts: 6,075
Yup, you've pretty well got it. Standard junction table.
__________________
oh yeah... documentation... I have heard of that.

*** What Do You Want In The MS Access Forum? ***
Reply With Quote
  #10 (permalink)  
Old 12-05-05, 17:19
JimmyFo JimmyFo is offline
Registered User
 
Join Date: Dec 2005
Posts: 6
Thanks, my man! Big help!
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