Solved

Normalizing address table

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

PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

Question has a verified solution.

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

Why is this different from all of the other step by step guides?  Because I make a living as a DBA and not as a writer and I lived through this experience. Defining the name: When I talk to people they say different names on this subject stuff l…
This article explains how to reset the password of the sa account on a Microsoft SQL Server.  The steps in this article work in SQL 2005, 2008, 2008 R2, 2012, 2014 and 2016.
Via a live example, show how to shrink a transaction log file down to a reasonable size.
Viewers will learn how to use the UPDATE and DELETE statements to change or remove existing data from their tables. Make a table: Update a specific column given a specific row using the UPDATE statement: Remove a set of values using the DELETE s…

707 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