I would like the design a financial instrument terms and conditions database and can see 2 possible solutions. The first is what I call the minimal design that I see as having the greatest flexibility. The second would invovle having a Master database with a cascading update system into sub-tables that store the finer detail of each distinct security type.
As an example to illustrate these concepts. For the minimal design, I think only 4 columns are needed. This table I see as being the most versatile as Derivative instruments should easily be incorporated by including the new AttibuteName's
UpdateDate SecurityID AttributeName AttributeValue
----------------- ----------- --------------- ---------------
09/12/2011 18:01 1 Name HSBC Plc
09/12/2011 18:01 1 Ticker HSBA LN Equity
09/12/2011 18:01 1 SecurityType Equity
09/12/2011 18:01 1 Currency GBP
09/12/2011 18:01 1 Country UK
11/12/2011 12:23 2 Name RBS 6% 15-Mar-2015
11/12/2011 12:23 2 Ticker XS0000000123 Corp
11/12/2011 12:23 2 SecurityType Bond
11/12/2011 12:23 2 Currency EUR
11/12/2011 12:23 2 Country UK
11/12/2011 12:23 2 Coupon 6%
11/12/2011 12:23 2 Maturity 15-Mar-15
11/12/2011 12:23 2 CouponFreq 2
While most financial instruments do not change their properties, this method does allow for exotic derivatives that have barrier triggers to be changed easily as the SecurityType can be changed at a later date when the trigger-event changes the security characteristics. This method also preserves the securitie's "old" characteristics which are retained (the UpdateDate defines the effective date upon which a securitie's details change). The only problem with this is that one would need to build a Pivot Type Query where the distinct AttributeNames are then transposed to be the column names of a new Pivot Table. (I am not sure what the correct term is but lets call it inflating the data).
This is a glimpse of how I see the second solution.
Name Ticker SecurityType SecurityID Currency Country
--------- --------------- ------------ ---------- -------- -------
HSBC Plc HSBA LN Equity Equity 1 GBP UK
Where AttributeName's are common to all securities (Name, Ticker, Currency), these columns would be stored in a SecurityMaster Table. Where instruments have "perculiarities", there would be a cascading update sub-table where the particular contract details would be held (for instance SecurityBond, SecurityEquityFuture, SecurityEquityOption, SecurityInterestRateFuture, ...)
Hopefully you can see the 2 paradigms. The first table is very compact and easily accomodates any security. The only problem with 1 is that one would need to build the Dynamic Pivot table code that essentially builds the individual SecurityType tables that would be created under paradigm 2.
Any comments/pointers would be welcome and apologies if anything is not clear (or where I have not used formal DB terminology). Especially if someone has the Pivot code to get from paradigm 1 to paradigm 2.
Many thanks and kind regards, Bertie p.s. Experience: 2-3 months of working with Sql Server Express (in a company with no Software Engineers).