Consolidate loan, purchase & sale tables into one transaction table.

Posted by Frank Computer on Stack Overflow See other posts from Stack Overflow or by Frank Computer
Published on 2010-06-13T20:29:02Z Indexed on 2010/06/13 20:32 UTC
Read the original article Hit count: 268

Filed under:

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.

© Stack Overflow or respective owner

Related posts about informix