Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> design question, number vs string datatype
Hello all:
I have a fairly simple situation. I have demographic data like this:
< 10,000
10,000 - 20,000
...
> 100,000
Along with other info like the individual's name, ssn etc. I would like to store this info in a table, but obviously I don't want to store the values above as strings. I'm planning to store them as number(2) in Oracle. That leaves 0-99 possible values for this field.
My question: Is this how others store this type of information? Do you leave the translation back from the db value to a range string up to the application code? Or do you store these translation values in another table like this:
income_trans table
id name
0 '< 10,000' 1 '10,000 - 20,000' ... 9 '90,000 - 100,000' 10 '> 100,000'
And then do a table lookup? I guess most queries will be how many people fall into each category, so the lookup would only have to be done once. Also, I believe bitmapped indexes would be appropriate for such a field correct? That is if the # of unique values was .01% or less.
Any comments?
Thanks,
Sean
Received on Mon May 11 1998 - 15:43:47 CDT