Hello all,

I have an 'items' table with 2 'types' of items -- 'foo' & 'bar'

Say that items of type 'bar' may be further classified as 'subtypes'  'baz',
'quux', etc.

Now I build an online store so that visitors may buy items.

Contstraints
1.) I would like to, as much as possible, use the same code for ordering
'foo'-items and 'bar'-items.
2.) If a user orders a 'bar'-item, they MUST specify a subtype. I.e. -- one
may buy a 'bar-baz', or a 'bar-quux', but NEVER a 'bar'.

My questions are these:
1.) Does it make more more sense to split the 'items' table into a 'foos'
table and a 'bars' table? This means I will often have to recombine them
using more than one query:
select * from foos where foos.id in (shoppingcart)
   +
select * from bars where bars.id in (shoppingcart)

2.) If I DON'T split into 2 tables, I must then keep the '#inStock' in both
the 'items' table (for 'foo'-items) and in the 'subtypes' table (for
'bar'-items). This doesn't feel right. Any suggestions?


Thanks, all!

--
WF




---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to