How can this table possibly be converted to a MySql table?

69 Views Asked by At

I got a TABLE in Excel format like:

enter image description here

SEE LARGE IMAGE HERE

This is a STEN TABLE containing FACTORS (A,B,C,D,E....etc)

Each Factor is like a separate test.

Each Factor i.e. Factor A has a [Raw Score] and a [Sten]

Supposing Factor A, had a question like:

-----------------------------------

Why do humans have Eyes?

The answer options could be like:

a) To Watch movies = [Raw Score] -> 10,

b) To Read Novels = [Raw Score] -> 5,

c) To close them while sleeping = [Raw Score] ->0

So if they Chose a) then, the system will go to the STEN TABLE to get the STEN Equivalent under Factor A, in this case, the sten equivalent will be 4. (See Factor A->Row score 10-> Sten column)

What could be the most practical way to have this STEN TABLE with Factors and their Raw Scores and Stens created?

Something like:

              **STEN TABLE**
                         |
                         |
                **FACTORS (A,B,C,D...)**
                      /     \
                     /       \
                    /         \
                   /           \
                  /             \
            **[Raw Score]      [Sten]**
                    


-----------------------

EDIT 1:

To a larger image, please click here: http://ctrlv.in/459785

Please note that, the stens are not equal for all Factors, though the Raw Scores are the same. i.e. in Factor A, [Raw Score]->3 = [sten]->2 but in Factor C [Raw Score]->3 = [sten]->1 and in Factor F [Raw Score]->1 [sten]->2 whereas in Factor E [Raw Score]->1 = [sten]->1.

Any Suggestion is highly appreciated.

1

There are 1 best solutions below

4
On

The table structure should be:

Questions
fields: id, factor, text

Answers
fields: id, question_id, text, raw_score

Sten-table(s)
fields: id; factor, raw_score, sten

The id is a unique primary auto-incrment field identifying the line. When you get the answer to a question, you take the factor from the question and the raw_score from the answer and do a simple select on the Sten-table like

SELECT sten FROM sten_table WHERE factor = 'A' AND raw_score = 10

EDIT
The Sten-table would have all lines from your Excel-sheet below eachother:
id, factor, raw_score, sten
1, A, 1, 1
2, A, 2, 1
3, A, .....
...
22, B, 1, 1
23, B, 2, 1
...