Results 1 to 6 of 6
  1. #1
    Join Date
    Nov 2011
    Posts
    3

    Unanswered: Help needed with table design

    Hi,

    I need to design a table for a dictionary application. It can be as simple as just storing the word and its meaning, but I need the output of the query to produce results in same fashion as a real world dictionary.

    For example, let us take that every page in the dictionary has 50 words. If the alphabet 'A' has 225 words, 5th page in my dictionary should be able to display the last 25 words that start with 'A' and continue with first 25 words that start with 'B'.

    How to design the table for this scenario, and what will be the query? I am not able to find a solution, since I am no professional database designer. Any help is much appreciated.

  2. #2
    Join Date
    Aug 2003
    Location
    Where the Surf Meets the Turf @Del Mar, CA
    Posts
    7,776
    Provided Answers: 1
    you are confusing data storage with data presentation.
    data is normalized & stored in Third Normal Form.
    It is the job of the User Interface to "properly" present the results to the end user.
    Data storage & data presentation are independent from each other.
    The data could be stored in flat files & presented to the end user in "book form".
    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
    Nov 2011
    Posts
    3

    Re

    Hi,
    I said I wanted the dictionary as in the real word, is not for presenting it to the user interface. Take for example I want to list 30 words starting from 'X'. Now if X has 20 words, Y has 20 words. I want the query to return 20 words from X and 10 words from Y. But the table might not have been sorted. Do yoou get me?

  4. #4
    Join Date
    Aug 2003
    Location
    Where the Surf Meets the Turf @Del Mar, CA
    Posts
    7,776
    Provided Answers: 1
    Create table dict_tbl (
    dict_word varchar2(128),
    word_def varchar2(4000));
    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.

  5. #5
    Join Date
    Nov 2011
    Posts
    3

    Re

    Now, how to select the sorted words starting with X and go on till Y and Z?

  6. #6
    Join Date
    Aug 2003
    Location
    Where the Surf Meets the Turf @Del Mar, CA
    Posts
    7,776
    Provided Answers: 1
    select dict_word from dict_tbl
    where substr(dict_word,1,1) >= 'X'
    order by 1
    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.

Tags for this Thread

Posting Permissions

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