[ic] Single SKU in Multiple Categories

interchange-users@interchange.redhat.com interchange-users@interchange.redhat.com
Fri Dec 21 15:18:00 2001


if you mess around with the table and/or UI, will there be any problems in
the future when you want to upgrade the IC to a newer version?

newbie,


-----Original Message-----
From: interchange-users-admin@interchange.redhat.com
[mailto:interchange-users-admin@interchange.redhat.com]On Behalf Of
Kevin Walsh
Sent: Friday, December 21, 2001 11:38 AM
To: interchange-users@interchange.redhat.com
Subject: Re: [ic] Single SKU in Multiple Categories


> I am looking at alternatives of having a single SKU show up in multiple
> categories. Looking through the archives, the best way to do this easily
> is either to do a join in a separate table in the database, or to add a
> second column in the products database table if the there are not going
> to be an excessive amount, but this is clearly poor database design.
> Someone had suggested seperating the category list by commas in the
> products table, but this does not work to produce the desired result.
> What you end up with is a new category with a name of the two categories
> seperated by a comma on the results.html page.
>
By far the best way would be to have one table for your categories,
one table for your products and a third "combination association"
table to link the two.  The third table would only need two columns:
"category" and "sku".  A non-unique index on each column will be
useful.

Coding multiple values into a single category column in the products
table will prove more trouble than its worth.  Any passing DBA will
not be able to stop himself from yelling out strange terms like
"Normalisation" and "1NF" whilst pointing at you in an "Invasion of
the Body Snatchers" sort of way. :-)

The complication will come in the administration:  You will need a
method of assigning SKUs to categories using this new table and,
unless you use a database with cascade-delete facilities, you will
need a method of removing the association records when either an SKU,
or a category is deleted.

I've done this before, and its no bother.  Just plan what you want,
and how you want to administer it, before you start.

Best of luck.

--
   _/   _/  _/_/_/_/  _/    _/  _/_/_/  _/    _/
  _/_/_/   _/_/      _/    _/    _/    _/_/  _/   K e v i n   W a l s h
 _/ _/    _/          _/ _/     _/    _/  _/_/    kevin@cursor.uk.com
_/   _/  _/_/_/_/      _/    _/_/_/  _/    _/

_______________________________________________
interchange-users mailing list
interchange-users@interchange.redhat.com
http://interchange.redhat.com/mailman/listinfo/interchange-users


_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com