Cardinality in Database - Relationship One to ONE

Asked

Viewed 559 times

1

I’m studying databases, and at the moment beyond bank definitions, type of models I’m seeing Cardinality! I’m having doubts in this exercise below:

inserir a descrição da imagem aqui

My doubts are as follows

How I identify the origem and the destino of this relationship?

For to me the origin would be Boleto and the Payment Destination..

I also wondered if my thoughts on cardinalidade that is correct!

To cardinalidade (0,1) for the billet and (1,1) for the payment... I’m sure?

But the answer to the exercise is :

Origem (min=1, max=1) and Destino (min=0, max=1)

That is- Apparently: payment as Origin and Boleto as destination!

  • The ways of representing the cardinalities change a lot, would you have the dashed line caption ? nr_boleto is probably a primary key, but vl_interest ? what would be the type ?

  • So there’s no legend! The exercise only asks to say the relationship:Identify the minimum and maximum cardinality of the origin and destination of the relationship

1 answer

2


There is a misconception in the post.

The term "cardinality" refers to number of instances of one object associated with another. It is usually used when dealing with a diagram of objects.

The correct term would be "multiplicity", which defines the minimum and maximum quantities to which an object may be associated. This term yes is used in a database model or in a class diagram.

See the example below:

Exemplo de Diagramas Equivalentes

Now answering the questions: In such a model, there is no idea of origin and destination, because there is no flow of information; what exists are relationships between entities. Thus, what is represented in the diagram is as follows:

"The t_boleto entity is associated with a single t_payment (1.. 1), while a payment t_payment is associated with a single t_boleto as well (although undeclared, when there is no indication of multiplicity, the value is understood to be 1.. 1, as per UML metamodel)."

The answer given to the exercise does not seem correct, but it seems that actually considers the t_payment as Origin and t_boleto as Destination and I do not know what was the basis for this.

Browser other questions tagged

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