Consolidate loan, purchase & sale tables into one transaction table.
- by Frank Computer
INFORMIX-SE with ISQL 7.3:
I have separate tables for Loan, Purchase & Sales transactions. Each tables rows are joined to their respective customer rows by:
customer.id [serial]
= loan.foreign_id [integer];
= purchase.foreign_id [integer];
= sale.foreign_id [integer];
I would like to consolidate the three tables into one table called "transaction", where a column:
transaction.trx_type char(1) {L=Loan, P=Purchase, S=Sale}
identifies the transaction type. Each transaction will be assigned a unique transaction number [serial]. Is this a good idea or is it better to keep them in separate tables? Storage space is not a concern, I think it would be easier programming & user-wise to have all types of transactions under one table, whenever possible. This implies denormalization.