Reputation: 11098
I have the following relationships (Business rules):
So ownership or a company can be made up of a number of companies and users.
So I have developed the following:
So does there have to be at least 4 tables for this sort of relationship or can it be simplified. I feel it is quite complicated and would not be intuitive for another developer? How could it be optimized and elegantly arranged?
Upvotes: 0
Views: 2439
Reputation: 7284
I think ownership and employment are different concepts, that would be more advised to have them separated.
Think about John who is one of the owners of A
company and in the mean time he is the CTO of A
.
Company and People can have a base to reduce redundancy of entities.
Upvotes: 2
Reputation: 11098
Based on the suggestions of Thilo
A separate relationship table was created for owners and employees respectively.
Furthermore, the company_ownership
and ownership
tables were removed as having a company as an owner is solved by adding an owning_user_id
and owning_company_id
where one will always be null. The percentage figure is added to this relationship table.
See below:
Upvotes: 1