How to make a total disjunction in EER diagram? (Mysql Worckbench)

Asked

Viewed 241 times

0

Hello, I need to deliver a sales system and I need to make the entity "payment form" one of these sub-classes (card, check, billet or deposit), only one per instance... How to represent the relationship in the EER diagram?

The way it is in the image is wrong, because every instance of "form of payment" will have the foreign keys of all sub-entities, even putting to be DEFAULT NULL will be somehow wrong, how to proceed?

Preciso fazer com que a entidade "forma de pagamento" seja uma dessas sub classes (Cartao, cheque, boleto ou deposito), somente uma por instância... Como representar o relacionamento no diagrama EER?

  • do not make these tables for the types of payment conditions, most of the columns repeat, and if a new condition appears, will have to create another table ?! leave type only as a column within the condition... depending on the condition some columns will be used, others will not, but no problem

1 answer

0

Normalises the payment entity.

Creates a single payment table with the required fields and also creates a Payment Type table. Then add a Fk to the pay table.

This way you will only have two tables for all types of payment

Browser other questions tagged

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