Sunteți pe pagina 1din 3

Enhanced ERD

Permanent employ (E-no, E-Name, Basic Salary)


Contract employ (E-no, E-Name, Monthly Salary)
Daily employ (E-no, E-Name, Daily Salary)

In this method the variables are reused. So what can be the solution?

Employ (E-no, E-name, Basic Salary, Monthly Salary, Daily Salary)

But again in this case every time two variables are not used, for example in case of permanent
employ the monthly salary and daily salary are not needed.

Specialization
E-no E-name Type

Super Type Employ Sub-type discriminator

Subtypes
Daily Employ
Permanent Employ
Contract Employ

E-no D-Sal
E-no B-Sal E-no M-Sal
DBMS

www.bscs15.tk www.ttdate.tk www.leemedia.tk


Specifying constraints in Super Types / Sub-Types
1. Completeness Constraints
It specifies whether an instance of a super type MUST also be member of a subtype or
not.
a. Total Specialization Rule
It says that an instance of a super type MUST be member of some sub type, (if
we only have three types).

b. Partial Specialization Rule


It says that an instance of a super type can exist without being member of any
sub type, e.g., works as a volunteer.

2. Disjoint Rule
It specifies that, can an instance of a super type be member of two or more sub types,
simultaneously or not.
a. Disjoint Rule
It says that if an instance of a super type is member of some sub type then it can
not be member of some other sub type.
Example is of radio buttons
Select one of the following (only one can be selected in this case);
Tea
Coffee
Cold Drink

d
DBMS

www.bscs15.tk www.ttdate.tk www.leemedia.tk


b. Overlap Rule
It says that an instance of a super type can simultaneously be member of two or
more sub types (for example a vehicle can be a car as well a 4 wheel drive)
Example id of check boxes
Select one of the following (only one can be selected in this case);
Tea
Coffee
Cold Drink

Subtype Discriminator
It is an attribute of super type to determine the target sub type

Multiple Relationship (Normal ERD)

Student Register Course

Grade

Goes through

Two entity classes may have more than one relationship


DBMS

www.bscs15.tk www.ttdate.tk www.leemedia.tk

S-ar putea să vă placă și