|
|
|
|
|
by fauigerzigerk
1962 days ago
|
|
I think what lucian1900 may be thinking is that instead of create table purchase_order (
id int primary key,
ordered_on timestamptz not null,
customer_id int not null references customer,
canceled_on timestamptz
);
you could have create table purchase_order (
id int primary key,
ordered_on timestamptz not null,
customer_id int not null references customer
);
create table order_cancelation (
order_id int primary key references purchase_order,
canceled_on timestamptz not null
);
This is indeed a better normalised schema and it allows you to index order_cancelation.canceled_on without worrying about nulls. |
|