Results 1 to 3 of 3
  1. #1
    Join Date
    Aug 2015
    Posts
    1

    Unanswered: Storing data in HASH tables

    I am currently studying for my exam and examining last years exam paper.

    Exam Question

    Now suppose that the Sites table is stored in a hash table that uses SiteID as the hash key. Load the following records with SiteID values 9, 16, 12, 7, 20, 30 into the table. We assume that records are inserted into a hash table in the given order using the hash function h(K) = K mod 8, where K is a SiteID value. Each bucket is one disk block and holds 2 records.

    Solutions

    h(9) = 9 mod 8 = 1
    h(16) = 16 mod 8 = 0
    h(12) = 12 mod 8 = 4
    h(7) = 7 mod 8 = 7
    h(20) = 20 mod 8 = 4
    h(30) = 30 mod 8 = 6

    My question

    how do you determine which record goes to watch bucket? in other words, how do u get the very last value of each row ?

  2. #2
    Join Date
    Aug 2003
    Location
    Where the Surf Meets the Turf @Del Mar, CA
    Posts
    7,776
    Provided Answers: 1
    what does this question have to do with Oracle RDBMS?
    You can lead some folks to knowledge, but you can not make them think.
    The average person thinks he's above average!
    For most folks, they don't know, what they don't know.
    Good judgement comes from experience. Experience comes from bad judgement.

  3. #3
    Join Date
    Jun 2003
    Location
    West Palm Beach, FL
    Posts
    2,713
    If you are referring to Hash Cluster Tables, then
    There is a structure called a hash bucket (not watch). Each output possibility is related to a single hash bucket. If the output range is from 0 to 8, there will be 9 hash buckets.
    This means that if you have MOD 8 as your hash function, then you will have 9 hash buckets ( 0 - 8 ).
    The person who says it can't be done should not interrupt the person doing it. -- Chinese proverb

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •