Thread: Column type
01-05-11, 17:17 #1Registered User
- Join Date
- May 2004
Unanswered: Column type
I'm getting stuck, designing a DB for some work, because I can't get a simple solution for showing data and storing that data.
The problem is as follows:
I have a table on which I want to save some characteristics on a type of machinery, but this characteristics must be grouped in similarity and indicating if this a value of single choice, of multiple choice or an input value, for example fuel (petrol, gas, ethanol, etc), movement (forward, backward), weight (input). I was thinking on a nested table of varchar, no problem for storing and displaying on my application with this kind of approach.
CREATE TYPE characteristics AS TABLE OF VARCHAR2(100) / CREATE TABLE characteristic (id NUMBER, type_choice NUMBER , characteristic characteristics) COMMENT ON COLUMN type_choice IS '1-single choice;2-multiple choice;3-value input' / insert into characteristic (id,type_choice,characteristic) values (1, 1,characteristics('forward','backward') / insert into characteristic (id,type_choice,characteristic) values (2, 3,characteristics('weight') /
I can do this:
CREATE TABLE machinery (id NUMBER, name VARCHAR2 , characteristic VARCHAR2,value NUMBER) / insert into machinery (id,name,characteristic) values (1, 'BOBCAT','forward') / insert into machinery (id,name,characteristic,value) values (1, 'BOBCAT','weight',2500) /
I will be very thankful for any idea.
01-05-11, 18:11 #2Registered User
Provided Answers: 1
- Join Date
- Aug 2003
- Where the Surf Meets the Turf @Del Mar, CA
GOOGLE "Third Normal Form" & design the data accordinglyYou 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.