[AccessD] When to Use a Junction Table

Charlotte Foust cfoust at infostatsystems.com
Fri May 4 11:14:26 CDT 2007


The first rule is "Never believe 'never'".  When I hear that word, I
automatically assume the change will come sooner, not later.  I always
normalize this kind of data because it makes it so much easier in the
long run...or in the short run if the change comes next week.  

Let's see, I've heard things like:
	The account code will never be longer than 8 characters (oops,
we changed accounting programs...)
	We'll never need more than two addresses
	We'll never need a <fill in the blank> field - we don't capture
that information
	A company will never have more than one contact name
	A contact will never have more than one email address/phone
number/mailing address/street address
... Get the picture?

Charlotte Foust

-----Original Message-----
From: accessd-bounces at databaseadvisors.com
[mailto:accessd-bounces at databaseadvisors.com] On Behalf Of
Elizabeth.J.Doering at wellsfargo.com
Sent: Friday, May 04, 2007 7:36 AM
To: accessd at databaseadvisors.com
Subject: [AccessD] When to Use a Junction Table

Hullo Gurus!

I'm trying to decide if I am just lazy since it is Friday.  Or if this
will come around later to haunt me .....

A bank has a call center for handling people who have questions about
their credit cards.  Call center workers are divided into groups which
have slightly different permissions to give certain kinds of credits.
The list of groups is very limited--three groups--and the list of
credits is pretty limited as well, perhaps 35.

The right way to structure tables so that I can look up to see if a
certain user in a certain group has a certain permission is absolutely
to have a table Credit and another table Group and a junction table
Permission with foreign keys CreditID and GroupID (and a primary key of
PermissionID.)  

The lazy way causes me less grief in the short term:  I make one table
Credit, with three additional true/false fields for the three Groups.
This way, I spent less time today documenting tables and sprocs to make
officialdom happy.  In the long run however, I have more grief if a new
Group is added.  Of course, everyone swears there will never be a new
Group.  

In all of your combined experience, does "there will never be a new
Group" mean, "there will be a new Group next week" or "there will be a
new Group, but not for years and years" ?  How would you structure this?

Thanks, 


Liz 


Liz Doering
elizabeth.j.doering at wellsfargo.com
612.667.2447


"This message may contain confidential and/or privileged information. If
you are not the addressee or authorized to receive this for the
addressee, you must not use, copy, disclose, or take any action based on
this message or any information herein. If you have received this
message in error, please advise the sender immediately by reply e-mail
and delete this message. Thank you for your cooperation"

--
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com




More information about the AccessD mailing list