I'd like to store company data which has branch and each branch has different department. I have the following options:
- Create Company, Branch and Department entity to store 3 different information.
- create one entity which has the cyclic relationship and use company type to differentiate. Possible data structure: company (id, CompanyName, type, parent) possible data:
Company.
Id >CompanyName >Type >Parent
1 >Honda >HQ >NULL
2 >Honda US >B >1
3 >Honda Japan >B >1
4 >Honda US HR >D >2
5 >Honda US Sales >D >2
I am inclined to use option 2 as if there is a new requirement like Conglomerate as high level the option 2 will be able to resolve it without introducing new table.
Will this design make sense or it will cause the problem in the future? Please comment.