I think that's a matter of how you feel like looking up the data, string
sorted is ok, but then what if that changes, you have to change the string,
inside the table, but if its columnar and theres an row for each item/color
pair I think it would be easier to have a join table that links an item to
its color choices...

...tony

tony weeg
senior web applications architect
navtrak, inc.
www.navtrak.net
[EMAIL PROTECTED]
410.548.2337

-----Original Message-----
From: mayo [mailto:[EMAIL PROTECTED]
Sent: Tuesday, December 02, 2003 3:43 PM
To: CF-Talk
Subject: store dB - question re items

Up to now when creating a store I've been selling items such as CDs which
would have band, title, check to see the amount still in stock, etc...

Now I'm creating a store front for a sweater manufacturer.

There are a variety of different sweaters. No problem :-) There are a
variety of different color. Again, no problem :-)

Sweater A comes in colors red and white.
Sweater B comes in colors white and blue.

Problem: how to set up the db to handle this.

TABLE ITEMS (table of all the items to be displayed/sold)

itemID (PK)

TABLE COLORS (table of all the potential colors - used to populate
itemColors)

colorsID (PK)
color

TABLE ITEMCOLORS (table listing all colors for a particular item)

itemColorsID (PK)
itemID
colorsID

To get the colors for Sweater A do a

SELECT *
FROM itemColors
WHERE itemID = whatever

That was the first idea. What about a field in ITEMS called itemColors so
that the record for Sweater A would look like

itemID | 1001
itemName | Sweater A
itemColor | red, white

thx

Gibert Midonnet
[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]

Reply via email to