Hi All,
I'm new to SQL databases but I'm supposed to come up with a way to
convert our flat file to MySql. The problem appears to be common
but I haven't been able to glean the exact answer from reading the
archives. (There seem to be several different approaches that
would work.)
Here's the problem: Our survey has 100 check box questions, and
the person is supposed to check as many as he or she thinks is
appropriate. We store this data in a flat file, 100 comma
separated values (keywords), as a "True/False" field.
Now I understand that in MySql a single table, with one
column for each checkbox question, is probably not an
appropriate "normal form" SQL table. So there seem to be
two alternatives:
1) Have a second table of 100 keywords, one keyword for
each check box. Use the person's ID as the foreign
key in this second table.
2) Have one table for _each_ of the 100 keywords, with
values T and F.
The project is going to get a bit more complicated later,
in that we also have questions where a person has to
select one of five categories for the answer, but for
now I'm just trying to grasp how to handlethe 100
checkbox keywords issue.
At least I'm having fun. I just got mysql, mysqld,
phpmyadmin working on our network, and it looks like
a lot more fun than flat files.
Thanks,
Jay