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
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
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)
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)
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