Solved

Normalizing address table

Posted on 2014-09-24
3
171 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-
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

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…
In this article we will learn how to fix  “Cannot install SQL Server 2014 Service Pack 2: Unable to install windows installer msi file” error ?
This videos aims to give the viewer a basic demonstration of how a user can query current session information by using the SYS_CONTEXT function
Viewers will learn how to use the SELECT statement in SQL and will be exposed to the many uses the SELECT statement has.

730 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