Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Yet another design question 1

Status
Not open for further replies.

up2late

MIS
Mar 10, 2005
7
US
object:
I have agents working across 3 States. Each agent covers more than one county. I started by setting up an agent table and a table for each state. The state tables have 2 fields, auto_increment and county name.
From reading some other posts here I think I've done this wrong. For best results I should have 1 table that tracks all the counties and add another field to it for state. So it would hold ID, county name, and state name. Does that sound like a better way to do it?
Second question is whats the best way to track (in the agent table) the several counties that each agent works? I know I should list the ID from the county table, but whats the best way to do that? Should I have a text field with the county IDs in it? Thats sounds like it would slow everything down.
Thank you for any advice you can give.
Dave
 
The following tables should work:

Agents:
Agent code (PK)
Agent name
any other info

Agent_assignments (one record for each county assigned to an agent):
Agent code (PK)
State code (PK)
County code (PK)
any other info

Counties:
State code (PK)
County code (PK)
County name

States:
State code (PK)
State name
 
Thank you for the quick reply and advice. I'll start reworking it tonight.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top