Solved

Normalizing address table

Posted on 2014-09-24
3
164 Views
Last Modified: 2014-09-24
I'm working on a database design and trying to normalize my address table (see the attached image of my database diagram).  I have a contact table that is a 1-to-many relationship to my address table.  A contact can have a mailing address and a shipping address.  Should I create another table for the type of address?  What is the best approach to normalizing my address table for the type of address?  I suppose I could just add another column to the address table to specify if it is a mailing or shipping address, but I'm wondering the if the better approach would be to create a separate table for the type of address (mailing or shipping).  

Also, I'm trying to figure out how to create a session table.  For example, if someone logs into the application and then gets timed out, how can I keep their session login information so when they come back to the application it remembers who they are and can take them right back to where they were in the application.  Is there an article that explains how to create/store a users session information for retrieval and brining them back to the application where they were and continuing where they left off?

Thanks for any help.
Regards.database design
0
Comment
Question by:-Dman100-
  • 2
3 Comments
 
LVL 25

Accepted Solution

by:
Lee Savidge earned 500 total points
ID: 40342103
Personally I'd have a link table and I wouldn't link the address directly to the contact. Go via the link table and have the type in there with a owerID field because you may wish to link an address at some point to a bank and a contact. This way, your type is held in the link table and you have one address while specifying one address. Most CRM systems do it this way.
0
 

Author Comment

by:-Dman100-
ID: 40342183
Hi Lee,

Thanks for responding to my post.  Can you clarify what you mean by link table?  I'm assuming you mean a table that sits between the contact table and the address table, correct?  Would that table just have the "Address Type" field (shipping or mailing) and Id field, and address Id field and a contact Id field?  Am I understanding that correctly?

Any thoughts on how to create a session table?

Thanks again for your help!
0
 

Author Comment

by:-Dman100-
ID: 40342259
See the updated database diagram using a linked table.  Is this what you meant?

Thanks.
9-24-2014-10-44-31-AM.jpg
0

Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Having an SQL database can be a big investment for a small company. Hardware, setup and of course, the price of software all add up to a big bill that some companies may not be able to absorb.  Luckily, there is a free version SQL Express, but does …
Ever needed a SQL 2008 Database replicated/mirrored/log shipped on another server but you can't take the downtime inflicted by initial snapshot or disconnect while T-logs are restored or mirror applied? You can use SQL Server Initialize from Backup…
Via a live example, show how to setup several different housekeeping processes for a SQL Server.
Viewers will learn how the fundamental information of how to create a table.

867 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now