dbTalk Databases Forums  

Code for "bucket-ized" time table???

comp.databases.olap comp.databases.olap


Discuss Code for "bucket-ized" time table??? in the comp.databases.olap forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
New Guy
 
Posts: n/a

Default Code for "bucket-ized" time table??? - 05-18-2004 , 06:14 PM






Hello,

First, I want to apologize for posting this message to multiple
groups. (1) I have a hard time finding any info and (2) this is not a
school assignment.

I am trying to create in my Oracle test database a "time" table that
would have time buckets. What I mean is that, it would have some
structure like this

0-5 minute bucket
10-15 minute bucket
15-20 minute bucket
....
55-60 minute bucket
0-2 hour bucket
2-4 hour bucket
4-6 hour bucket
....
22-24 hour bucket
day number
week number
month number
year number

How can I go about doing this? I'm very new to data-warehousing and
have never had to this before. Any suggestions, code
snippets...anything is welcome!

Thanks in advance for any help you can provide!

KS.

Reply With Quote
  #2  
Old   
Hans Forbrich
 
Posts: n/a

Default Re: Code for "bucket-ized" time table??? - 05-18-2004 , 06:43 PM






New Guy wrote:

Quote:
I am trying to create in my Oracle test database a "time" table that
would have time buckets. What I mean is that, it would have some
structure like this

Are you allowed to use Oracle capabilities, or do you need to be 'vendor
neutral'?

If you are allowed to take advantage of Oracle native capabilities,
hopefully you are using Oracle9i R2. Then look up the NTILE and
WIDTH_BUCKET functions, and the examples, in the Oracle supplied manual

Oracle9i Data Warehousing Guide
Release 2 (9.2)
Part Number A96520-01

available at http://docs.oracle.com ... (table of contensts at
http://download-west.oracle.com/docs...a96520/toc.htm)


Also I highly recommend a gander at 'Mastering Oracle SQL' from
http://oracle.oreilly.com/ as it gives the logic behind those functions -
as well as many many more SQL tricks that your typical developer misses.

/Hans


Reply With Quote
  #3  
Old   
Joerg Narr
 
Posts: n/a

Default Re: Code for "bucket-ized" time table??? - 05-22-2004 , 08:33 AM



"New Guy" <kshop (AT) adnohr (DOT) net> schrieb im Newsbeitrag
news:2e50789c.0405181514.11ee3328 (AT) posting (DOT) google.com...
Quote:
I am trying to create in my Oracle test database a "time" table that
would have time buckets. What I mean is that, it would have some
structure like this

0-5 minute bucket
10-15 minute bucket
15-20 minute bucket
...
55-60 minute bucket
0-2 hour bucket
2-4 hour bucket
4-6 hour bucket
...
22-24 hour bucket
day number
week number
month number
year number

A vendor neutral approach could be to create an additional bucket dimension
(with a key column in your fact table) if each fact has this dimensionality.
This would allow your users to see how the bucket usage developed over time.

Kind regards,

Joerg




Reply With Quote
Reply




Thread Tools
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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.