Re: Making Complicated References

Поиск
Список
Период
Сортировка
От Daniel R. Anderson
Тема Re: Making Complicated References
Дата
Msg-id 1049067807.496.12.camel@ny-chicagost2d-72.buf.adelphia.net
обсуждение исходный текст
Ответ на Re: Making Complicated References  (Dennis Gearon <gearond@cvc.net>)
Ответы Re: Making Complicated References
Список 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


В списке pgsql-general по дате отправления:

Предыдущее
От: Richard Welty
Дата:
Сообщение: redhat 7.1 upgrade
Следующее
От: "Daniel R. Anderson"
Дата:
Сообщение: Re: redhat 7.1 upgrade