I have the following database relational schema that purports to model an EMP supertype together with two FULL_TIME_EMP and PART_TIME_EMP subtypes:

database schema The problem I have is one of integrity i.e. I would like to make sure that a full-time employee can only have a corresponding row in the FULL_TIME_EMP table and similarly a part-time employee can only have a correponding row in the PART_TIME_EMP table.

As you will see from the screen captures below, this integrity constraint is not enforced.

Here is the EMP_TYPE table: EMP_TYPE table

And the EMP table: EMP table

The PART_TIME_EMP table: PART_TIME_EMP table

And finally the FULL_TIME_EMP table which presents the integrity violation!! FULL_TIME_EMP table

Is there a way to enforce this integrity constraint by altering my database model design or do I have to resort to triggers?

Regards,

没有正确的解决方案

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top