22
ER MODELING Prepared by Visakh V, Assistant Professor,Dept. of CSE, LBSITW

Slide 6 er strong & weak entity

Embed Size (px)

DESCRIPTION

strong & weak entity

Citation preview

Page 1: Slide 6 er  strong & weak entity

Prepared by Visakh V, Assistant Professor,Dept. of CSE, LBSITW

ER MODELING

Page 2: Slide 6 er  strong & weak entity

Prepared by Visakh V, Assistant Professor,Dept. of CSE, LBSITW

Strong & Weak

Page 3: Slide 6 er  strong & weak entity

Prepared by Visakh V, Assistant Professor,Dept. of CSE, LBSITW

Notations:

Identifying Relationship

Total Participation

Weak Entity Set

Page 4: Slide 6 er  strong & weak entity

Prepared by Visakh V, Assistant Professor,Dept. of CSE, LBSITW

Weak Entity :

Entity that cannot be uniquely identified by its attributes alone. Therefore it must use a foreign key in conjunction with its attribute to create a primary key.

Definition : An entity set may not have sufficient attributes to form a primary key.

Strong Entity :Definition : An entity set that has a primary key is termed as a strong entity set.

Weak Entity :

Page 5: Slide 6 er  strong & weak entity

Prepared by Visakh V, Assistant Professor,Dept. of CSE, LBSITW

Page 6: Slide 6 er  strong & weak entity

Prepared by Visakh V, Assistant Professor,Dept. of CSE, LBSITW

Loan Payment

Loan#

Amount Payment_amount

Payment_no

Payment_date

LoanPayment

1 N

Discriminator

Owner Entity Set Identifying Relationship

Weak Entity Set

Total Participation

LoanPayment

Page 7: Slide 6 er  strong & weak entity

Prepared by Visakh V, Assistant Professor,Dept. of CSE, LBSITW

Page 8: Slide 6 er  strong & weak entity

Prepared by Visakh V, Assistant Professor,Dept. of CSE, LBSITW

Identifying or Owner Entity Set : For a weak entity Set to be meaningful, it must be associated with another entity set called identifying or owner entity set.

Identifying Relationship : The relationship associating the weak entity set with the identifying relationship.

: It is many to one from the weak entity set to owner entity set.

: The participation of the weak entity set in the relationship is total.

Page 9: Slide 6 er  strong & weak entity

Prepared by Visakh V, Assistant Professor,Dept. of CSE, LBSITW

Discriminator : It is a set of attributes that allows distinguishing among all those entities in the weak entity set that depend on one particular strong entity.

: It is also called partial key of the weak entity set.

Primary key of the weak entity set

Primary key of the Owner entity set

Discriminator of the weak entity set

Page 10: Slide 6 er  strong & weak entity

Prepared by Visakh V, Assistant Professor,Dept. of CSE, LBSITW

Note : The identifying relationship set should have no descriptive attributes.

Professor DepartmentLoanPayment

Since

Page 11: Slide 6 er  strong & weak entity

Prepared by Visakh V, Assistant Professor,Dept. of CSE, LBSITW

Page 12: Slide 6 er  strong & weak entity

Prepared by Visakh V, Assistant Professor,Dept. of CSE, LBSITW

Properties :

A Weak Entity set can participate in relationship other than the identifying relationship.Ex : payment & account

A Weak entity set may participate as owner in an identifying relationship with another weak entity set.

Page 13: Slide 6 er  strong & weak entity

Prepared by Visakh V, Assistant Professor,Dept. of CSE, LBSITW

It is also possible to have a weak entity set with more than one identifying entity set.

Then

Primary key of the weak entity set

Union of Primary keys of the Owner entity set

Discriminator of the weak entity set

Page 14: Slide 6 er  strong & weak entity

Prepared by Visakh V, Assistant Professor,Dept. of CSE, LBSITW

Total Participation: Every entity in the set is involved in some association (or tuple) of the relationship

Partial Participation: Not all entities in the set are involved in association (or tuples) of the relationship

Notation :

Page 15: Slide 6 er  strong & weak entity

Prepared by Visakh V, Assistant Professor,Dept. of CSE, LBSITW

Page 16: Slide 6 er  strong & weak entity

Prepared by Visakh V, Assistant Professor,Dept. of CSE, LBSITW

Recursive Relationships and Role Names

•Recursive relationship: An entity set relating to itself gives rise to a recursive relationship

•Role Names –used to specify the exact role in which the entity participates in the relationships

•Essential in case of recursive relationships•Can be optionally specified in non-recursive cases

Page 17: Slide 6 er  strong & weak entity

Prepared by Visakh V, Assistant Professor,Dept. of CSE, LBSITW

Page 18: Slide 6 er  strong & weak entity

Prepared by Visakh V, Assistant Professor,Dept. of CSE, LBSITW

Page 19: Slide 6 er  strong & weak entity

Prepared by Visakh V, Assistant Professor,Dept. of CSE, LBSITW

Page 20: Slide 6 er  strong & weak entity

Prepared by Visakh V, Assistant Professor,Dept. of CSE, LBSITW

Page 21: Slide 6 er  strong & weak entity

Prepared by Visakh V, Assistant Professor,Dept. of CSE, LBSITW

Page 22: Slide 6 er  strong & weak entity

Prepared by Visakh V, Assistant Professor,Dept. of CSE, LBSITW