1

There is a table person (which has among autoincremented primary key field id such fields as firtsname and lastname).

There is a table employee whose primary (but not autoincremented) personid is a foreign key for person.id. (Thus every employee is a person.) employee has several additional fields, such as the date of hiring the employee.

Whether a person is an employee can be checked knowing his ID by checking whether there is a employee row with this personid.

Now I need to introduce a few more kinds of persons:

  • children
  • kins of children

A way to do this is to add to person table an ENUM field: ENUM('other','child','kin').

But I wonder that it could be done in different ways for employees versus childs and kins.

Should I create special tables for children and kins, just like a special table for employees, even despite for now these tables may have only one field, the primary key personid?

Well, it may happen that in the future I may add more fields to these tables, but I'm not sure whether it even happens.

Also having separate tables for childs and kins would allow to manage foreign keys better, such as the obvious foreign keys for the table which relates childs and kinds by their degree of kinship.

porton
  • 745
  • 3
  • 11
  • 28

0 Answers0