Aditya Naidu
Aditya Naidu

Reputation: 697

What type of relationship does this example of weak and strong entity sets have?

Consider a strong entity set:

Building(Building_id , Name , Area_occupied , Number_of_floors)

And a weak entity set:

Room(Room_number , Room_area_occupied , Capacity , Building_id)

In entity set Room, Building_id is a foreign key referring to primary key of Building entity set. A building can have many rooms and obviously, one room belongs to one hotel.

i). Is it a composition relationship?

ii). How do you denote a composition relationship in an ER diagram. Specifically, how do you denote has-a and has-many relationships in ER diagrams?

iii). If ER diagram uses diamond to represent a relationship, How do you find out by looking at it if it is a composition, an association etc.?

Upvotes: 0

Views: 619

Answers (1)

reaanb
reaanb

Reputation: 10064

i). "Composition relationship" isn't a formal term in the entity-relationship model. As in your other question, I'll take it to mean a binary relation (a,b) that is left-total (every a is related to some b) and a->b (an a is related to just one b).

(Building_id, Room_number) -> Building_id fulfills this requirement.

Note that my definition is based on your own description in Identifying relationships vs composition relationships? and not necessarily the correct/only definition for has-a relationships.

ii). Based on the preceding definition:

Has relationships

iii). Based on the preceding definition, you would look for total participation (double association line) on one side and functional dependency (cardinality of 1) on the other side of the diamond.

An association would be any relationship between entity sets.

Upvotes: 0

Related Questions