Agencies document tracker

I'm creating an agencies document tracker database. I've already started the database which I've attached. But i want to format the database so that the DERA table will be the main table follow by the counties and agencies so that he can look like the second attachment.  Any assistance will be appreciated.
Edmond Sane-AkaAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

slightwv (䄆 Netminder) Commented:
I don't see any foreign keys in the database.

If DERA is the main table and Counties is a child table, it will likely be a many-to-many relationship.

If so, you will need an intermediate table like dera_county that holds and

Same for the relationship between counties and agencies.  If ALL agencies are in the same county then you might get by with just adding a county_id column to the agencies table.

That said:  The agency and county tables are pretty much the same format.  I might think about merging them into a single documents table with a owner_type column with a 'C' or 'A' column to designate County or Agency.

If you have additional columns for county that don't belong to agencies then you can create separate county and agency tables but I would look to keep the document table independent with the appropriate foreign key column in it.
Edmond Sane-AkaAuthor Commented:

thanks for the advice I'll try that
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.