943,948 Members | Top Members by Rank

Ad:
Apr 12th, 2009
0

Database Design Question

Expand Post »
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.
Similar Threads
Reputation Points: 10
Solved Threads: 1
Newbie Poster
wblakenc is offline Offline
19 posts
since Apr 2009
Apr 12th, 2009
0

Re: Database Design Question

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.
Reputation Points: 10
Solved Threads: 1
Newbie Poster
wblakenc is offline Offline
19 posts
since Apr 2009
Apr 13th, 2009
0

Re: Database Design Question

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.
Reputation Points: 27
Solved Threads: 29
Posting Whiz
timothybard is offline Offline
317 posts
since Mar 2007
Apr 14th, 2009
0

Re: Database Design Question

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.
Featured Poster
Reputation Points: 665
Solved Threads: 427
Posting Genius
debasisdas is offline Offline
6,406 posts
since Feb 2007
Apr 14th, 2009
0

Re: Database Design Question

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.!
Reputation Points: 10
Solved Threads: 1
Newbie Poster
wblakenc is offline Offline
19 posts
since Apr 2009

This thread is solved

Either the thread starter or a moderator has marked this thread as solved. You can most likely trust the responses and answers given. There is most likely no reason for any further responses to be posted here. If you have a related question, please start a new thread in this forum instead.

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in Database Design Forum Timeline: Ternary relationship? ER model for search engine
Next Thread in Database Design Forum Timeline: Best Free Web-based Database





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC