Re: [SQL] [OT] Inventory systems (private)

2002-12-09 Thread Troy
insdag 3 december 2002 15:47 > Aan: Ries van Twisk > CC: [EMAIL PROTECTED] > Onderwerp: Re: [SQL] [OT] Inventory systems (private) > > > Ries, > > One solution is to create a table such as follows: > > CREATE TABLE inventory (id serial, product text, > PRI

Re: [SQL] [OT] Inventory systems (private)

2002-12-03 Thread Dan MacNeil
You might create a seperate attribute tables. table: items id name table: attributes id description table: item_attributes item_id attribute_id SELECT items.name, attributes.description FROM items, attributes, item_attributes WHERE items.id=item_attributes.item_i

Re: [SQL] [OT] Inventory systems (private)

2002-12-03 Thread Troy
Ries, One solution is to create a table such as follows: CREATE TABLE inventory (id serial, product text, PRIMARY KEY (id) ) ; CREATE TABLE attributes (prodid int4, textkey text, textvalue text, int4value int4, FOREIGN KEY (prodid) REFERENCES inventory (id) MATCH FULL ON DELETE C

Re: [SQL] [OT] Inventory systems (private)

2002-12-03 Thread Ries van Twisk
: Re: [SQL] [OT] Inventory systems (private) Ries, One solution is to create a table such as follows: CREATE TABLE inventory (id serial, product text, PRIMARY KEY (id) ) ; CREATE TABLE attributes (prodid int4, textkey text, textvalue text, int4value int4, FOREIGN KEY (prodid)

Re: [SQL] [OT] Inventory systems (private)

2002-12-03 Thread Andy Tawse
While I'm not expert what I would do is something like this Items table fields: item_id item_name Attributes table fields: attribute_id attribute_name Item_Attr table fields: item_id attribute_id attribute_value Now an item can be associated with any number of attributes. 03/12/2002 13:17