| Oracle FAQ | Your Portal to the Oracle Knowledge Grid | |
Home -> Community -> Usenet -> comp.databases.theory -> database 'practice' question
This was the most relevant newsgroup for my query despite its title
and despite my question! I hope someone can help ...
This is the setup.
We have some people (traders). A person may have many accounts (accounts). Each account has many transactions (trades) associated with it.
Trying to think which is 'better' and why: to include TraderID as a foreign key of Accounts or to have a *separate* table which contain the 'links' between traders and accounts. I can't work out really why you'd have one over the other and for what reasons? I mean, you could argue that the trader who owns the account is nothing to do with the account itself and so should be in a different 'look-up' table. How would you think about it?
Many thanks for any replies or explanations.
Emma
i.e.
Traders
AND
Accounts OR Accounts AND TradersAccounts ======== ======== =============== AccountID AccountID TraderID TraderID Balance AccountIDBalance
AND
Trades OR Trades AND other tables like ====== ====== AccountsTrades TradeID TradeID TradersTrades AccountID Description TraderID ProfitLoss Description
![]() |
![]() |