I have a doubt. Please read the below example carefully.
- There is an Income type called Other Income
- Every single Other Income May or May Not be subjected to VAT.
- One Other Income can have only one VAT, if it has any.
As you can read in above points, the relation between the Other Income and VAT is One to One/ None.
Now see the below image.
We wanted the VAT
table to contain the Other_Income reference, so the idVat
is in Other_Income table.. In case you are wondering why there is a separate VAT table, that is because lot of other types of fees are subjected to VAT too.
However imagine due to some reason someone wanted the Other_Income table to contain the VAT reference. In this case, If you are using MySQL Work bench or GUI tool to build the diagram, the 1
in relationship line will be presented in the side of Other_Income
table and the 0..1
will be presented in the side of VAT
table.
However, whatever it is, it has the connection One to One/ None. So, there is no connection between Relationship and the location of the foreign key? In other words, there is no rule something like You must put the foreign key to X table of the relationship. Other table is prohibited.
?
As far as I can see and know there is no such rule, you can put the foreign key to any table in the relationship, it is just your preference and decision to make the things "work". However I would like to clear my doubt.
Update
The above is just an example to explain the question with more sense. Therefor, please do not make your answer depend on the "exact" above example.