21

I'm really confused on the difference between disjoint and overlapping design constraints in relational databases. I've looked around, but have had a hard time finding an understandable example. Could someone please explain this to me via an example?

Thanks!

5 Answers 5

22

Say you have a super class 'musician' then two sub classes 'singer' and 'guitar player'.

In a disjoint constraint you would have to put the musician in either one or the other sub classes. In an overlapping constraint the musician can be put in both.

15

Let's say you have a super class 'account' with sub classes 'Savings Account' and 'Current Account'. This is a disjoint constraint situation because a bank account can either be Savings or Current. It cant be both at the same time.

For an overlapping constraint situation, let's say we have a super class 'Person' and subclasses 'Customer' and 'Employee'. In this case, a person can be Customer and Employee both. Therefore, overlapping.

10

The disjoint rule states an entity instance of a supertype can only be a member of one subtype. The overlap rule states an entity instance of a supertype can be a member of multiple subtypes.

Example of disjoint rule: Instance of Super-type Animal can only be member of exactly one of these Sub-types being Panda, Cheetah and Dog Disjoint Union , (An animal can either be Panda or be Dog or be Cheetah but can't be any two or more at the same time)

Example of overlap rule: Instance of Super-type Person can be member of multiple Sub-types being Woman, Driver and Engineer Overlapping Union , (A person can be a Woman and that same Woman can be Driver and that same Woman can be Engineer at the same time)

2
  • An example would help the OP, are you able to update your answer?
    – miltonb
    Nov 11, 2016 at 3:53
  • Should give an example. Otherwise this is the same language as any book
    – pblead26
    Apr 22, 2017 at 10:50
1

Let's simplify this confusing concept. First of all, understand that there is a discriminator between subtype and supertype. If the value of a discriminator is not null and appears in supertype entity instance then that must be linked with the only one subtype. This is called disjoint constraint.

For example, you say in school a person can be teacher and student but a teacher can't be a student and vice versa. Then in person supertype and (student, teacher) subtype exists a discriminator called person_type. If person_type in person entity is 't' then it is linked with teacher subtype only not with a student. Similarly, we can write it for the student.

Now, in overlapping constraint, the supertype entity instance can appear in many subtype instance.

In overlapping example consider a teacher can be a student also. Then 't' can be linked with student and teacher subtype entity.

0

suppose Member is super class and its two sub-classes one is student and 2nd one is faculty,if(Member) of subclass(student or faculty)not both then it is disjoint. if member both of its subclass then it non-disjoint or overlapping.

.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.