I've been designing DB tables so far, and I always get lost.
It's about whether the name should be on the transaction table.
Generally, it is good to code names and manage them centrally in a master table, but if you have a company name in the master and change the name in the master, it will be displayed as a new company name when you display past transaction information.Originally, it should be displayed by the company name at that time.In response to this case, we see a table design that has both the company code and the company name in the transaction table, but I feel that this is not normalized and does not make sense to code.
Another idea is that if the name changes, you can treat it as a different company and add new records to the master, but I think it's complicated because users have to look like they're the same company.
I always wonder what the best solution is, but how is it going?
Originally, it should be displayed by the company name at that time
Whether or not you should depends on your business requirements.
What the "best solution" is depends on your requirements.If you don't think about it first, the "best solution" doesn't actually meet the requirements, or the "best solution" requires meaningless complexity and slow processing of the requirements.
"If the ""Company"" master column is ""Company Code,"" ""Company Name,"" and ""Number of editions,"" it can be used to change the company name without changing the ""Company Code."""
If the table has meaning as a record, it is considered the company name at that time, and the company name is not subject to centralized management.
If you also need your current company name, you can always get the latest company name by having the company code.
© 2024 OneMinuteCode. All rights reserved.