1 CREATE TABLE transaction (
2 account varchar not null,
3 accounting_date date not null,
4 interest_date date not null,
5 use_date date not null,
6 reference varchar primary key not null,
7 trans_type varchar not null,
9 amount_out numeric(9,2),
10 amount_in numeric(9,2),
12 CHECK ((amount_in IS NULL) <> (amount_out IS NULL))