Model Entity Relationship: Ternary vs Aggregation?

Asked

Viewed 4,985 times

4

Supposing I have a ternary relationship: two entities among themselves are Nxn and the third entity is weak in relation to the relationship between these two.

I would like to know the difference between creating an aggregation between the two Nxn entities and leaving without aggregation and what each of the two options causes the database, if possible saying the advantages and disadvantages.

  • Show examples you want to compare, if possible:

1 answer

2

There is a slight difference in the MER and UML approaches, I believe that by your question these concepts are a little confused.

Notation MER x UML

In the Entity Relationship (MER) modeling there is the ternary relationship that is composed of independent entities with each other (this ternary is kind of complicated) note the examples.

In the book you can see some examples of ternary relationships, see:

Example 1

inserir a descrição da imagem aqui

Example 2

inserir a descrição da imagem aqui

Understand that in the context of MER it is possible to exist:

A ternary with 2 strong entities generating a daughter or weak entity example 2

A ternary with 3 strong entities (does not generate daughter or weak entity) example 1

I imagine that there is 1 strong entity generating 2 weak entities

Unified Modeling Language - UML

The UML introduces the concept of class(Entity) and the term association(relationship) between classes. The association can be divided into 2 types, they are: aggregation and composition

In this link: example of aggregation i found a very easy explanation about the types of association, the link article explains well the difference between aggregation and composition, which are types of association.

Answering the questions

If two entities have an M:N relation and you do not create the third entity to store the key attributes of the strong entities, then you will cause unnecessary record duplication in your database, because when you are implementing the SQL of your logical project, the primary key of table A will have to appear in table B and vice versa.

Source: Database Systems 6th edition, authors: Elmasri, Ramez Navathe, Shamkant B. Year: 2011, pg 131.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.