Re: Making Complicated References

From: "Daniel R(dot) Anderson" <dan(at)mathjunkies(dot)com>
To: gearond(at)cvc(dot)net
Cc: Bruno Wolff III <bruno(at)wolff(dot)to>, pgsql-general(at)postgresql(dot)org
Subject: Re: Making Complicated References
Date: 2003-03-30 23:43:27
Message-ID: 1049067807.496.12.camel@ny-chicagost2d-72.buf.adelphia.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

<snip>
> How about some table definitions?
</snip>

below is a simplified version:

CREATE TABLE products
(
product_key varchar(80), primary key,
attribute_1 varchar(80), not null,
attribute_2 varchar(80), not null,
...
attribute_n varchar(80) not null
);

CREATE TABLE sizes
(
product_key varchar(80), references products,
packaging_type varchar(80), -- i.e. Bags
-- i.e. Drums
-- i.e. Bottles
weight varchar(80) -- i.e. 5lbs
-- i.e. 1 gallon
-- i.e. 8 oz.
);

So now I want to create a table called orders. This table must
reference the item_number in products AND reference the packaging type
and weight so that if somebody orders stearic acid they can't select a
4.3 lb bag if we only sell 50lb bags.

This is what I mean by ¨complicated references¨

Thanks in advance,

-Dan

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Daniel R. Anderson 2003-03-30 23:47:51 Re: redhat 7.1 upgrade
Previous Message Richard Welty 2003-03-30 23:28:59 redhat 7.1 upgrade