Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: Design Question - variable number of elements per table

Re: Design Question - variable number of elements per table

From: Jon Armstrong <noaddress_at_noaddress.org>
Date: Fri, 28 May 2004 17:26:23 -0400
Message-ID: <40b7aee1_4@corp.newsgroups.com>


Alfie,

Try something like, tables snapshot and pairs.

snapshot contains (one entry per snapshot):

- id
- stock_id
- time

pairs contains (variable number of entries per snapshot):

- id
- snapshot_id
- amount
- price

Regards... Jon

Jon Armstrong

"Alfie" <not_at_home.com> wrote in message
news:40b785d9$0$25328$cc9e4d1f_at_news-text.dial.pipex.com...
> Hi,
>
> I wondered if there was some sort of structure which enabled a variable
> number of elements per table - I'm pretty sure there isn't - but maybe
> there's a way.
>
> Anyway, say I have a stock which is traded. I have any number of deals
> struck at various prices over time. So I have a "Trade" entity thus
>
> Stock Id
> Time
> Amount
> Price
>
> I will take various snapshots of the trading history to work with.
>
> Each snapshot can have a variable number of prices at which trades were
> struck with associated volume (sum of trades).
>
> Can anyone think of a way I can have a meaningful 'Snapshot' Table such as
>
> Stock Id
> Snapshot time
> +a variable number of Amount/Price pairs attached.

-----= Posted via Newsfeeds.Com, Uncensored Usenet News =----- http://www.newsfeeds.com - The #1 Newsgroup Service in the World! -----== Over 100,000 Newsgroups - 19 Different Servers! =----- Received on Fri May 28 2004 - 16:26:23 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US