Database Design Question

Thread Solved

Join Date: Apr 2009
Posts: 13
Reputation: wblakenc is an unknown quantity at this point 
Solved Threads: 1
wblakenc wblakenc is offline Offline
Newbie Poster

Database Design Question

 
0
  #1
Apr 12th, 2009
Hello everyone,
I have a fairly simple question about database design. I have a database for county voting equipment. Each county has multiple pieces of voting equipment. I currently have two tables, one with counties and one with voting equipment. Is there any reason to have a relational table between them or is it sufficient to have a county ID field in the equipment table and link them that way. Is there any pro to having a intermediate table between counties and equipment? Any drawback with linking them directly?

Thanks in advance.
Reply With Quote Quick reply to this message  
Join Date: Apr 2009
Posts: 13
Reputation: wblakenc is an unknown quantity at this point 
Solved Threads: 1
wblakenc wblakenc is offline Offline
Newbie Poster

Re: Database Design Question

 
0
  #2
Apr 12th, 2009
Posted this in the wrong area... Sorry!

I know this should be in the database design area, however I was too quick to select MySQL as that is what I am using.
Reply With Quote Quick reply to this message  
Join Date: Mar 2007
Posts: 305
Reputation: timothybard is an unknown quantity at this point 
Solved Threads: 25
timothybard's Avatar
timothybard timothybard is offline Offline
Posting Whiz

Re: Database Design Question

 
0
  #3
Apr 13th, 2009
Since the relationship between the tables is a one-to-many relationship, you do not need an intermediate table. You only need to have the following structure:

County: ID (PK), Name, etc.
Voting Equipment: ID (PK), County ID (FK), type, etc.

If counties shared machines so that a machine can be used by more than one county, then you would need an intermediate table. The reason is because you would then have a many-to-many relationship, which requires a independent table showing how the two entities are related.
Reply With Quote Quick reply to this message  
Join Date: Feb 2007
Posts: 2,094
Reputation: debasisdas will become famous soon enough debasisdas will become famous soon enough 
Solved Threads: 128
debasisdas's Avatar
debasisdas debasisdas is offline Offline
Postaholic

Re: Database Design Question

 
0
  #4
Apr 14th, 2009
you do not need an intermediate table only defining the relationship by PK and FK will do that for you. But from your post i am not use what exactly you are looking for. I think you need to pass more information.
Share your Knowledge.
Reply With Quote Quick reply to this message  
Join Date: Apr 2009
Posts: 13
Reputation: wblakenc is an unknown quantity at this point 
Solved Threads: 1
wblakenc wblakenc is offline Offline
Newbie Poster

Re: Database Design Question

 
0
  #5
Apr 14th, 2009
Perfect! This is what i was thinking, but just wanted to make sure I fully understood why and when I would need an intermediate table.

Thanks again for the help.!
Reply With Quote Quick reply to this message  
Reply

This thread has been marked solved.
Perhaps start a new thread instead?
Message:



Similar Threads
Other Threads in the Database Design Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC