I'm going to ask you a question that will help:
Is it right to insert the "id_company" column in almost every table?
Only you can say this. Only you know the requirements of your system. If there is any reason to have these columns in almost all tables, that's right.
Probably what you're doing is called multitenancy . The opposite of this is having a database for each company and not mixing the data. Each of these approaches has both advantages and disadvantages.
It is not very common to do this, I would avoid but I do not know your case. Without getting too much into the details that is not the focus of the question, the main advantages are:
- it is easier to do data consolidation for all companies (if needed);
- and facilities for maintenance
The main disadvantages are:
- the inflexibility to adapt the scheme for the different companies;
- difficulty filtering data that really matters.
But there is a solution to everything. It's just a matter of what's easiest for your situation.
Can the user manage more than one company at a time? How is this handled in the application? This helps decide.
With the additional comments I would say that's right. I still say that I can not speak without knowing the whole situation. But if "Company" means branch it makes more sense to keep everything in the same database and obviously each entry line will need to have an ID of which branch it belongs to. It has to know how to filter the data whenever it is to work with just one affiliate - this is usually more common - but it seems to be a small work close to the advantages of having everything together for manipulation by the same person.