I have 3 entities in my system. Let’s call them entity A,B and C. Entity A becomes Entity B, and in turn entity B becomes Entity C. I have to keep copies of all 3 entities.
My dilemma is how to represent them in a relational data. All 3 entities have similar fields. However, some fields are applicable to some entities and some are not.
What is the recommended approach in this case. Should I use one table and then make a ‘Type’ field ? The problem with this approach is that some fields will be empty for soem entities. Or should I create separate tables?
Any recommendation on best practice would be greatly appreaciated
this sounds like the manager -> personnel type of hierarchical design. You may have separate tables for each entities. But if they are of same base type when you want to get list of all people, then you have to union all tables. If you use a hierarchy column with a single table approach then you have to join the table with itself. Consider these two options while choosing one solution. Both are right but have their own difficulties.