DB design for master file in enterprise software

Posted by Thang Nguyen on Stack Overflow See other posts from Stack Overflow or by Thang Nguyen
Published on 2010-06-09T17:17:59Z Indexed on 2010/06/09 17:22 UTC
Read the original article Hit count: 295

Filed under:

Dear all.

I want to write an enterprise software and now I'm in the DB design phase. The software will have some master data such as Suppliers, Customers, Inventories, Bankers...

I considering 2 options:

  • Put each of these on one separate table. The advantage: the table will have all necessary information for that kind of master file (Customer: name, address,.../Inventory: Type, Manufacturer, Condition...). Disadvantage: Not flexible. When I want to have a new type of master data, such as Insurer, I have to design another table.

  • Put all in one table and this table have foreign key to another table which have type of each kind of master data (table 1: id, data_type, code, name, address....; table 2: data_type, data_type_name). Advantage: flexible - if I want more master data such as Insurer, I just put in table 2: code: 002, name: Insurer, and then put detail each insurer into table 1). Disadvantage: table 1 must have sufficient field to store all kind of information including: customer name, address, account, inventory's manufacturer, inventory's quality...).

So which method do you usually do (or you think work better). Thank you very much

© Stack Overflow or respective owner

Related posts about database