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.

Recommended Answers

All 4 Replies

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.

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.

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.

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.!

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.