So I have started modelling some entity relationships.
It goes as follows:
A
Mandate
represent a client. A row for a client (Mandate) will only appear once in theMandate
table.Each
Mandate
can have one or moreAsset
, and the sameAsset
can be had by differentMandates
. This is relationship is modelled through theMandate Asset Bridge
, in which aMandate ID
will be linked to one or moreAsset ID
.The goal of the
Asset
table is for an asset to be on a single row of the table (thus no two same assets will appear).The issue comes when considering
Security
. The security are parameters forAsset
and are dependent on theMandate
, soMandate1
could haveAsset1
withSecurity1
, andMandate2
could haveAsset1
withSecurity2
. There cannot exist an entry forSecurity
without it being linked to anAsset
.At the moment, given the model, the same
Asset
will need to be duplicated for all differentSecurity
parameters. So while inAsset
, the Bloomberg ID, Name, Underlying, etc... will always be the same, in the example aboveAsset1
will need to be appear twice, once with theSecurity1 FK
and once with theSecurity2 FK
.This to me breaks some normalisation i.e., if the Bloomberg ticker changes, I have to go through the
Asset
table, and change that all occurrences of the sameAsset
Solution
One possible way of solving this I guess is to create a three-way bridge table, which in my case would contain MandateID, AssetID, and Security ID.
I've never encountered a situation like this. Is this a good way of doing it? Intuitively I would say no, it does not seem very elegant, but I'm not sure.
See below for what a three-way associative relation would look like.
Let me know if anything is not clear.
FKs
), however the rule "There cannot exist an entry for Security without it being linked to an Asset." does not hold. Problem is in wording, it is hard to understand. For example Asset has a ticker, say Apple IncAAPL
. Security hasISIN
, say AppleUS0378331005
; but there is an association table in between? Describe relationship between asset and security. If mandate is a client (person, organization?) how do asset and security depend on it?