08.02.2014 Views

Web-DSS-Chapter-03

Web-DSS-Chapter-03

Web-DSS-Chapter-03

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

44 CHAPTER 3 ■ Entity-Relationship Modeling<br />

3.8 Unary Relationship<br />

As we mentioned in Section 3.5, a unary relationship (R ∈ E 1 × E 1 ) is an association between two<br />

entities of the same entity type. Figure 3.12(a) displays the E-R diagram of a unary relationship<br />

IsMarriedTo. Whenever two people in the entity type PERSON get married, the relationship instance<br />

IsMarriedTo is created. The Date of marriage is an attribute of this relationship. Since a<br />

person can only be married to one other person, marriage is a one-to-one relationship. Furthermore,<br />

since a person can be unmarried, the minimum cardinality of the IsMarriedTo relationship<br />

is zero.<br />

Figure 3.12(b) depicts several relationship instances of this relationship type. Each relationship<br />

instance (r1, r2, r3, and r4) connects two instances in PERSON. The lines allow us to<br />

PERSON<br />

IsMarriedTo<br />

Date<br />

(a)<br />

PERSON<br />

p1<br />

p2<br />

p3<br />

p4<br />

p5<br />

p6<br />

p7<br />

p8<br />

p9<br />

IsMarriedTo<br />

r1<br />

r2<br />

r3<br />

r4<br />

p10<br />

p11<br />

p12<br />

(b)<br />

Figure 3.12 The unary one-to-one relationship.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!