I have an entity that holds two different sub-entities, e.g, a company that holds different trainees and using a trainee entity that holds special attributes, with the identifier being the trainee_id.
The trainee might be either student or an employee in a company. The training program needs to differentiate between the trainees, so i made the student and the employee as two different sub-entities in the trainee entity.
Obviously, the training program will deal with the trainees by their trainee_id, so the trainee_id will be the primary_key for the both sub_entities, and the sub-entities can't have a special identifier (i can't use the student's id as a primary key for the sub_entity).
I want to derive an important non-primary key from the sub-entity with its primary key (trainee_id) to the related entity.
How can i derive a non-primary key as a foreign key to another table?