Adobe Dreamweaver Forums



Last 10 THreads :         A little help Plx..On data base linking (Last Post : NedWebs - Replies : 1 - Views : 2 )           »          List flash component In Director (Last Post : DAVID NAJAR - Replies : 2 - Views : 5 )           »          CS4 slow in Leopard (Last Post : msteegeee - Replies : 0 - Views : 1 )           »          Controlling position of + and ? when adding text sizecontrols (Last Post : MarkFulton - Replies : 0 - Views : 1 )           »          Controlling position of + and ? when adding text sizecontrols (Last Post : MarkFulton - Replies : 0 - Views : 1 )           »          form validation (Last Post : Harvey Waxman - Replies : 0 - Views : 1 )           »          Problem with Scene changes (Last Post : Shezzle01 - Replies : 0 - Views : 1 )           »          Drop-Down Boxes showing blank (Last Post : Geetartha Kashyap - Replies : 3 - Views : 4 )           »          Problems handling xml data for tree control. (Last Post : gallaharsha - Replies : 0 - Views : 1 )           »          Master Page ?? (Last Post : SujitG - Replies : 1 - Views : 3 )           »         


Home Register FAQ Members List Calendar Search Today's Posts Mark Forums Read
User Info Statistics
Go Back   Adobe Dreamweaver Forums > Other Macromedia/Adobe Products > Cold Fusion
 
Tags:



Reply
  #1 (permalink)  
Old 10-01-2008, 03:56 AM
echowebs
 
Posts: n/a
Diggs:
Default Normalization - should I bother

I am stuck on some business logic and was hoping any of you database
normalization geeks (and I say that with the utmost respect) had an
opinion......

Here is my situation:

I have to create a db containing a list of businesses and their owners.
Their owners have to each have their own log in to the db records.

The trouble is this: Each business has 2 addresses - the physical and the
mailing.
These two addresses will ALWAYS belong to the primary owner as well.
Also each secondary owner MAY have two mailing addresses but many will have
only one.
The reason the 2nd owner may have a second address is for seasonal purposes.
i.e. Sep-Mar is Florida, the rest of the time in NH.

So in the end each business will have no less than two addresses and no more
than four,
and also no less than one owner and no more than two.

I am having trouble normalizing the structure - or even deciding if I should
in this case b/c it is so ridiculous.

Any thoughts?

thanks all,
Chris



Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 10-01-2008, 03:56 AM
Ian Skinner
 
Posts: n/a
Diggs:
Default Re: Normalization - should I bother

Not so ridiculous, actually rather common.

I would normalize and it should not be that difficult.

BUSINESS table
fields that describe a single business such as name, etc.

PERSON or maybe OWNER table
fields that describe a single person such as name, etc.

ADDRESS table
fields to describe an address such as street, town, zip, etc.

BUSINESS ADDRESS table
a join table that links the key of one business to the key of one
address per record. Multiple records for multiple address

PERSON ADDRESS table
a joint table that links the key of a person to a key of one address
per record. Extra fields could describe when a given address applies to
a person of this is desirable.

With this pattern it would be very easy to have as many or as few
address per entity as required. Because one thing one can guarantee
about data; "sooner or later there will be an exception." And it is
always best to plan for this as much as possible.

You may also want fields that allow you to do do 'soft' deletes by
describing records as active and inactive. That makes it easy to keep
historical data when addresses and names change that is not possible if
the older data is destroyed when this happens.



Reply With Quote
  #3 (permalink)  
Old 10-01-2008, 03:56 AM
Dan Bracuk
 
Posts: n/a
Diggs:
Default Re: Normalization - should I bother

If you didn't normalize it, how would you structure it?

So far we know that a business can have many owners, so that's a one to many
relationship.

I would certainly acknowlege the possibility that an owner could have more
than one business, so let's change that to a many to many. The fields would be
business_id, owner_id, and primary_true_false.

The physical address seems to belong to the business, but could there be more
than one? If you can't find out, assume that there could. That's another one
to many, possibly having a field to indicate the primary address.

Owner addresses are one to many and appear to be date dependent. Looks like
you are going to need a table resembling

address_id, date
to indicate the current mailing address for that owner.

You have of course acknowleged the possibility that an owner may move, right?

Reply With Quote


Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



© Camley Interactive (camley.info) 2008 - all logos and images are copywrite their respective owners.
Proud member of the Camley Interactive Network
All times are GMT. The time now is 12:30 PM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.1.0 ©2007, Crawlability, Inc.
Inactive Reminders By Mished.co.uk