Solved

Normalizing address table

Posted on 2014-09-24
3
162 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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

When you hear the word proxy, you may become apprehensive. This article will help you to understand Proxy and when it is useful. Let's talk Proxy for SQL Server. (Not in terms of Internet access.) Typically, you'll run into this type of problem w…
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 …
Via a live example, show how to extract insert data into a SQL Server database table using the Import/Export option and Bulk Insert.
Viewers will learn how to use the SELECT statement in SQL to return specific rows and columns, with various degrees of sorting and limits in place.

762 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

18 Experts available now in Live!

Get 1:1 Help Now