Re: A newbie paradox: is this a PK-FK (relationship) problem, or programming problem?

From: tina <>
Date: Sun, 23 Dec 2007 18:13:53 GMT
Message-ID: <Bzxbj.308453$>

you're welcome; as i said, it should give you a solid core guideline. just stick to the normalization rules and you'll be fine. :)

"raylopez99" <> wrote in message On Dec 22, 4:38 pm, "tina" <> wrote:

Thanks Tina! I like your solution, it seems to make sense and even be in Third Normal Form or somesuch...very nice!

I will model it and if I have any problems will report back.


> tblPersons
> PersonID (pk)
> FirstName
> MiddleInitial
> LastName
> <other fields that describe the person only.>

> tblStocks
> StockSymbol (pk)
> StockName
> <other fields that identify the stock only.>

> tblBrokerages
> BrokID (pk)
> BrokName

> tblAccounts
> AcctID (pk)
> PersonID (fk)
> BrokID (fk)
> <other fields that describe a specific account for a specific person.>

> tblAccountStocks
> AcctStockID (pk)
> AcctID (fk)
> StockSymbol (fk)

> tblTransactions
> TransID (pk)
> AcctStockID (fk)
> <other fields that describe a specific transaction of a specific stock in
> specific account.>

> the relational structure is
> tblPersons.PersonID 1:n tblAccounts.PersonID
> tblBrokerages.BrokID 1:n tblAccounts.BrokID
> tblAccounts.AcctID 1:n tblAccountStocks.AcctID
> tblStocks.StockSymbol 1:n tblAccountStocks.StockSymbol
> tblAccountStocks.AcctStockID 1:n tblTransactions.AcctStockID

> tblAccounts is a junction (linking) table between tblPersons and
> tblBrokerages.
> tblAccountStocks is a junction (linking) table between tblAccounts and
> tblStocks.
> and tblTransactions is a simple child table of tblAccountStocks.
> so you can trace each transaction record back to a specific stock in a
> specific account belonging to a specific person.

> i don't know a thing about stock markets and trading, so i imagine this is
> simplified structure,
Received on Sun Dec 23 2007 - 19:13:53 CET

Original text of this message