I have stumbled upon a problem during database design. Let me explain what it is all about:
Contract has some simple attributes that describe him, and
may have annexes and dynamics of payment.
Therefore I have decided to make main table
Contracts
, and placed simple attributes as columns.
Dynamics of payment is a complex attribute of
Contracts
table. It can have none, one or multiple values. Searching through the Internet I have learned that this is called
multivalued attribute, and have found
this example[
^] that seems to illustrate my case very well ( Dynamics of payment is equivalent to the Hobbies table in the linked example ).
As for Annexes, it is a complex attribute of
Contract
. Contract can have many of them, one or none.
Annex has
exactly the same simple attributes as contract, and can also have Dynamics of payment. Annex' relationship with Dynamics of payment is the same as the relationship between Contract and Dynamics of payment.
To sum-it-up, Annex and contract have everything the same, the only difference is that Annex is a complex attribute of Contract.
Using
this[
^] as a reference, I have made the sketch of my
ER diagram[
^].
This is the first time I see this type of relationships so I ask the community to help me convert this ER diagram into SQL or relational tables.
I apologize for not providing more info, if you have further requests please leave a comment and I will update my post immediately.
Thank you for your understanding and help.
Best regards.