Dbms Notes Lecture 9 : Specialization, Generalization and Aggregation

7,910 views 26 slides Jul 24, 2020
Slide 1
Slide 1 of 26
Slide 1
1
Slide 2
2
Slide 3
3
Slide 4
4
Slide 5
5
Slide 6
6
Slide 7
7
Slide 8
8
Slide 9
9
Slide 10
10
Slide 11
11
Slide 12
12
Slide 13
13
Slide 14
14
Slide 15
15
Slide 16
16
Slide 17
17
Slide 18
18
Slide 19
19
Slide 20
20
Slide 21
21
Slide 22
22
Slide 23
23
Slide 24
24
Slide 25
25
Slide 26
26

About This Presentation

Specialization, Generalization and aggregation in E R Diagram


Slide Content

UNIT 1
Lecture 9
EER Model

Extended E R Model
1.Specialization
2.Generalization
3.AttributeInheritance
4.Aggregation
Dinesh Kumar Bhawnani, BIT DURG

Specialization
•Theprocessofdesignatingsub-groupingsor
dividingahigherlevelentitysetintoanumberof
lowerlevelentitysetonthebasisofspecific
featuresisknownasspecialization.
•ItisanTop–Downapproach.
Dinesh Kumar Bhawnani, BIT DURG

Generalization
•Theprocessofgroupingorjoiningtwoormorelower
levelentitysetstomakeahigherlevelentityseton
thebasisoftheircommonfeaturesisknownas
generalization.
•It is an Bottom –Up approach.
Dinesh Kumar Bhawnani, BIT DURG

Specialization/ Generalization
•IntermsofanE-Rdiagram,specializationisdepictedbya
trianglecomponentlabeledISA.
•TheISArelationshipmayalsobereferredtoasasuperclass-
subclassrelationship.
•Higherandlower-levelentitysetsaredepictedasregular
entitysetsi.e.,asrectanglescontainingthenameofthe
entityset.
Dinesh Kumar Bhawnani, BIT DURG

Generalization/ Specialization
Dinesh Kumar Bhawnani, BIT DURG
PERSON
ISA
CUSTOMER EMPLOYEE
Name
Street
City
Cust_id Emp_id
Salary

Generalization/ Specialization
Dinesh Kumar Bhawnani, BIT DURG
ACCOUNT
ISA
CHECKING-ACCOUNT SAVINGS-ACCOUNT
Acc_No
Balance
Overdraft_Amount Interest_Rate

Generalization/ Specialization
Dinesh Kumar Bhawnani, BIT DURG
STUDENT
ISA
UNDER-GRADUATE POST-GRADUATE
Stud_Id
Stud_Name
Discipline
Specialization

Difference
No. Specialization Generalization
1It is a Top Down approach. It is a Bottom Up approach.
2Specialization stems from a single entity set;
it emphasizes differences among entities
within the set by creating distinct lower-
level entity sets.
Generalization proceeds from the recognition
that a number of entity sets share some
common features (namely, they are described
by the same attributes and participate in the
same relationship sets).
3The process of designating sub-groupings
within an entity set is called specialization.
The process of designating groupings from
various entity sets is called generalization.
4Specialization is a result of taking a subset
of higher level entity set to form a lower-
level entity set.
Generalization is a result of taking the union of
two or more disjoint (lower-level) entity sets to
produce a higher-level entity set.
Dinesh Kumar Bhawnani, BIT DURG

Attribute Inheritance
•Acrucialpropertyofthehigherandlower-level
entitiescreatedbyspecializationandgeneralizationis
attributeinheritance.
•Theattributesofthehigher-levelentitysetsaresaid
tobeinheritedbythelower-levelentitysets.
Dinesh Kumar Bhawnani, BIT DURG

Constraints on Specialization/ Generalization
•Condition-defined.Incondition-definedlower-
levelentitysets,membershipisevaluatedonthe
basisofwhetherornotanentitysatisfiesan
explicitconditionorpredicate.
•User-defined.User-definedlower-levelentity
setsarenotconstrainedbyamembership
condition;rather,thedatabaseuserassigns
entitiestoagivenentityset.
Dinesh Kumar Bhawnani, BIT DURG

Condition -Defined
Dinesh Kumar Bhawnani, BIT DURG
ACCOUNT
ISA
CHECKING-ACCOUNT SAVINGS-ACCOUNT
Acc_No
Balance
Overdraft_Amount Interest_Rate
Account_Type

Dinesh Kumar Bhawnani, BIT DURG
PERSON
ISA
EMPLOYEE
Name
Street
City
CUSTOMER
Salary Credit_Rating
ISA
OFFICER SECRETARYTELLER
Officer_No
Station_No
Hours_Worked
Hours_Worked
User -Defined

Constraints on Specialization/ Generalization
•Asecondtypeofconstraintrelatestowhetherornotentitiesmay
belongtomorethanonelower-levelentitysetwithinasingle
generalization.Thelower-levelentitysetsmaybeoneofthe
following:
•Disjoint.Adisjoint-nessconstraintrequiresthatanentitybelongto
nomorethanonelower-levelentityset.
•Overlapping.Inoverlappinggeneralizations,thesameentitymay
belongtomorethanonelower-levelentitysetwithinasingle
generalization.
•Lower-levelentityoverlapisthedefaultcase;adisjoint-ness
constraintmustbeplacedexplicitlyonageneralization(or
specialization).WecannoteadisjointednessconstraintinanE-R
diagrambyaddingtheworddisjointnexttothetrianglesymbol.
Dinesh Kumar Bhawnani, BIT DURG

Disjoint Constraint
Dinesh Kumar Bhawnani, BIT DURG
ACCOUNT
ISA
CHECKING-ACCOUNT SAVINGS-ACCOUNT
Acc_No
Balance
Overdraft_Amount Interest_Rate
Account_Type
disjoint

Dinesh Kumar Bhawnani, BIT DURG
PERSON
ISA
EMPLOYEE
Name
Street
City
CUSTOMER
Salary Credit_Rating
ISA
OFFICER SECRETARYTELLER
Officer_No
Station_No
Hours_Worked
Hours_Worked
Overlapping

Constraints on Specialization/ Generalization
•Afinalconstraint,thecompletenessconstraintonageneralizationor
specialization,specifieswhetherornotanentityinthehigher-levelentity
setmustbelongtoatleastoneofthelower-levelentitysetswithinthe
generalization/specialization.Thisconstraintmaybeoneofthefollowing:
•Totalgeneralizationorspecialization.Eachhigher-levelentitymustbelong
toalower-levelentityset.
•Partialgeneralizationorspecialization.Somehigher-levelentitiesmaynot
belongtoanylower-levelentityset.
•Partialgeneralizationisthedefault.
•WecanspecifytotalgeneralizationinanE-Rdiagrambyusingadouble
linetoconnecttheboxrepresentingthehigher-levelentitysettothe
trianglesymbol.
Dinesh Kumar Bhawnani, BIT DURG

Total Specialization/ Generaliztion
Dinesh Kumar Bhawnani, BIT DURG
ACCOUNT
ISA
CHECKING-ACCOUNT SAVINGS-ACCOUNT
Acc_No
Balance
Overdraft_Amount Interest_Rate
Account_Type

Dinesh Kumar Bhawnani, BIT DURG
PERSON
ISA
EMPLOYEE
Name
Street
City
CUSTOMER
Salary Credit_Rating
ISA
OFFICER SECRETARYTELLER
Officer_No
Station_No
Hours_Worked
Hours_Worked
Partial

Aggregation
•OnelimitationoftheE-Rmodelisthatitcannot
expressrelationshipsamongrelationships.
•Aggregationisanabstractionthroughwhich
relationshipsaretreatedashigherlevelentities.
Dinesh Kumar Bhawnani, BIT DURG

ER Diagram with redundant relationships
Dinesh Kumar Bhawnani, BIT DURG
JOB
EMPLOYEE BRANCH
MANAGER
works-on
manages

ER diagram with Aggregation
Dinesh Kumar Bhawnani, BIT DURG
MANAGER
manages
JOB
EMPLOYEE BRANCHworks-on

Draw the ER diagram for a banking enterprise
Dinesh Kumar Bhawnani, BIT DURG

Dinesh Kumar Bhawnani, BIT DURG
E R Diagram Notations

University Questions
1.Write short notes on
1.Generalization
2.Specialization
3.Disjoint and overlapping constraints
4.Condition defined and user defined constraints
5.Total and partial generalization
2.Explain the constraints based on generalization and specialization.
3.Differentiate between specialization and generalization.
4.Explain aggregation with example.
5.Explain enhanced entity set model with examples.
Dinesh Kumar Bhawnani, BIT DURG

For Video lecture on this topic please subscribe to my youtubechannel.
The link for my youtubechannel is
https://www.youtube.com/channel/UCRWGtE76JlTp1iim6aOTRuw?sub
_confirmation=1
Dinesh Kumar Bhawnani, BIT DURG