mysql - Employee and Customer = People Table? -


is bad store information such as: name, phone number, address etc. in 1 table? result in employee , customer table having foreign key referencing "people" table.

if don't store such information in 1 table, have employee , customer table have lot of similar type of information.

what best design?

my personal preference: separate out customer , employee database. while of data may same between customer , employee, won't long before data requirements , rules start differing. example, employees may want store birth dates may not need customer.

keeping table prevents error in selects. if customers , employees reference in people , newcomer doesn't know join , when use where clause separate customers , employees, result may unexpected , may go undetected. having customer , employee separate avoids such issues.

having them separate helpful in adding customer table schema associated customers/orders etc., , employee tables can go hr related schema. different levels of protection can applied them.

people table's maintenance may affect customer , employee tables. example, if had add column in large people table, rdbms may lock table long. if tables separate, able prepare relevant group.

overall, see little benefit in creating people table fk related customer , employees. perhaps others on may raise benefits of people table.


Comments

Popular posts from this blog

angularjs - ADAL JS Angular- WebAPI add a new role claim to the token -

php - CakePHP HttpSockets send array of paramms -

node.js - Using Node without global install -