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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ERD design question

Status
Not open for further replies.

saimon65

Technical User
Jan 2, 2002
16
AU
Hi,
I have a table called Employee.
I want to place permanent address and current address.
What I thought was that Address table itself has got its own attributes like state,district so I cannot place a field inside the Employee table for the permanent and current address.
Therefore, I place a permanet_address and current_address field inside the Employee table and tried to create the links from the Address table. But, MS Access does not allow that. It says relationship already created.
What is the best design for this Permanent and Current address issue?...thanks
 
I would use three tables as shown below:

Table: Employee
PK - EmployeeID

Table: Address
PK - AddressID
Type (P = Perm; C = Current)

Table: Employee_Address
PK = EmployeeID + AddressID

Leslie

Anything worth doing is a lot more difficult than it's worth - Unknown Induhvidual

Essential reading for anyone working with databases: The Fundamentals of Relational Database Design
 
what about if the address for joe is permanent but for his cousin who's staying with him, it's temporary? sounds like they would need different addresses in your scheme, leslie

r937.com | rudy.ca
 
and I would want it that way so that each Employee has his/her own address record even if they are living with their cousin.
 
Why do you need a many to many table join? Are the addresses really unique? I have seen systems where 2 families or 2 adults can have the same address. However often people spell the street differently or some other thing and it is too combersome. Then sometimes people may have a vacation home or a vacation address or may live at another address during the summer. Or some people may actually have 2 full-time addresses. Another thing is having one address for a location and another address like a post office box for mail for business only. Then you may have phones that are home based and some that are not. That is another nightmare. Home Phone, Cell Phone, Fax Phone, Business Phone.

You should be able to have a joining table and a preferred address foreign key and have them both point to the same table. Either that or on the joining table add an extra field for the type of address however you want to describe it. In this way you can know what the preferred address is without reading joining to the address table and reading a table. It really describes the join and not the address and nothing but the address. There is nothing wrong with a join table having a field in it that better describes the join. You can actually select on the join if that is the case. Otherwise you would have to slece on one of the tables and then read multiple table entries in the join table, to find the correct join.

Anyway you could have a preferred Mail Address, or a designated Check Address.

If you do not like my post feel free to point out your opinion or my errors.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top