If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > General > Database Concepts & Design > db additional data question

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 03-15-11, 11:45
dpagini dpagini is offline
Registered User
 
Join Date: Mar 2011
Posts: 2
db additional data question

Hello all,

I am working on a database to store mutual fund data, and one table in particular to keep distributions for the fund.

The table already exists and was designed by my predecessor, and I think so far it is a good design. I will try to explain as best I can...

Columns:
id (pk, auto increment),
fundId (identifies to related fund)
dtAsOf (date of the distribution)
[3 other relevant date fields],
nValue (amount of the distribution)


Technically, I don't think I need id as fundId/dtAsOf could be a unique key, but it already exists and I generally do like to have the "id" field for tables. I have a data feed from a warehouse that populates this table, and comes in monthly. I have just learned of a requirement to have a 2nd feed come in yearly, and give a breakdown of the nValue. I think I have two correct options here, and one incorrect option, but I would like some validation on my thought process here.
One important note is that the sum of the breakdown does not equal the nValue, it's only a partial breakdown.

1) I would like to just add nValueBreakdown1 & nValueBreakdown2 columns to the original table, and when I find the fundId and dtAsOf in the yearly source, update the row with the breakdowns.
2) Add a second table with an id (pk), table1_id (fk), nValueBreakdown1 and nValueBreakdown2. This seems like overkill, but it would at least still be a good design, right?
3) Add a second table which is basically a duplicate of the 1st with the two additional columns. The reason for this is the data source is separate from the first table, even though the data is the same. To me, that is not an acceptable reason to add a new table with duplicate data.

What are your thoughts on these approaches? Thanks for sharing. Please ask any questions if anything was unclear.
Reply With Quote
  #2 (permalink)  
Old 03-15-11, 12:38
futurity futurity is offline
Registered User
 
Join Date: May 2008
Posts: 270
Quote:
Originally Posted by dpagini View Post
fundId/dtAsOf could be a unique key
Surely you meant to say "is a" and not "could be"?

Quote:
I have just learned of a requirement to have a 2nd feed come in yearly, and give a breakdown of the nValue.
I would create a second table that holds a foreign key to the distribution, the type of breakdown, and the breakdown amount. Your primary key would, presumably, consist of the distribution and the type of breakdown. The table would hold one row for each breakdown you want to record about a distribution.
Reply With Quote
  #3 (permalink)  
Old 03-15-11, 13:05
dpagini dpagini is offline
Registered User
 
Join Date: Mar 2011
Posts: 2
Thanks for the response. That is a better way to do option 2... Full disclosure, I was originally pulling for option 1 while a colleague wants to go with option 3, and I came up with option 2 as a middle ground, pretty hastily, as I was putting together this question. With your suggestion I would also be able to add more breakdowns than just the 2, should that possibility arise. I think this is probably the best way to go.

Would you agree that your proposed option is the most flexible and best designed, option 1 is acceptable but not optimal, and option 3 is just not a good design? Sorry to lead you into an answer there, but I guess I'm looking for some comments around all the possibilities. =)
Reply With Quote
  #4 (permalink)  
Old 03-15-11, 16:07
futurity futurity is offline
Registered User
 
Join Date: May 2008
Posts: 270
I'm obviously biased towards my recommendation, otherwise I wouldn't have recommended it.

None of your options appear normalized to me, so I'd stay away from them. On the other hand, without a detailed understanding of your requirements and the data you're attempting to model, I can't say for certain.
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On