1

What is the best practise if I have "is a" and "has a" relationships both in the same time as in figure below

enter image description here

Any help will be appreciated.

1

1 Answer 1

1

These kind of relationships where is-a and has-a both exist together are mostly self-referential relationships.

Classic example of such a relationship is employee to manager. Manager is an employee and Manager has many employees reporting to him.

So, the best practice is to make a foreign-key point to the same table. To elaborate - if we take the same example as employee-manager as I told above, then employee table will have a column 'manager' which is nothing but a foreign key to employee table itself.

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.