Solved

Normalizing address table

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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Introduction SQL Server Integration Services can read XML files, that’s known by every BI developer.  (If you didn’t, don’t worry, I’m aiming this article at newcomers as well.) But how far can you go?  When does the XML Source component become …
Ever wondered why sometimes your SQL Server is slow or unresponsive with connections spiking up but by the time you go in, all is well? The following article will show you how to install and configure a SQL job that will send you email alerts includ…
Viewers will learn how to use the INSERT statement to insert data into their tables. It will also introduce the NULL statement, to show them what happens when no value is giving for any given column.
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.

828 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