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

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • New Guy

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

    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...anyt hing is welcome!

    Thanks in advance for any help you can provide!

    KS.
  • Hans Forbrich

    #2
    Re: Code for "bucket-ized" time table???

    New Guy wrote:
    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

    Comment

    • Joerg Narr

      #3
      Re: Code for "bucket-ized" time table???

      "New Guy" <kshop@adnohr.n etschrieb im Newsbeitrag
      news:2e50789c.0 405181514.11ee3 328@posting.goo gle.com...
      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


      Comment

      Working...