Andrew Ward writes:
> The only way I can see of dealing with this is to create tables like
> ID,QUESTION,RESPONSE
> 1,"YEAR",2001
> 1,"SEX",1
> 1,"AGE",3
> 1,"RATING A", 7
> 1,"RATING B", 6
> ...
>
> This doesn't strike me as very smart. I would greatly value anyone's advice
> on dealing with data that is similar in many respects but different in
> others. Thank you very much.
If you want it to be fairly general you could have a table
with possible value types and then another table with the
actual values. It'll require more space and you might want to have
one table for numbers and another for strings, but if there
are a lot of different fields and most of them don't appear in
the majority of the entries (the rows in your example), doing
it like that may be motivated. It'd make some searches less
convenient, but on the other hand it'll be much easier to add new
fields.
Today I went from having a table with 38 rows for each line in an
input file (which was output from some software), to having a single
40-column row per line. This will be less convenient to handle as
it's muss less general, but on the other hand I saved some much-needed
space. (Some numbers: old: 12 bytes per row (19 with overhead), times
38 rows = 722 bytes. new: 100 or 133 bytes. Multiply with 30000 per
input file and 1000 for the number of input files within the first
year or two. Eek.)
--
Carl Troein - Círdan / Istari-PixelMagic - UIN 16353280
[EMAIL PROTECTED] | http://pixelmagic.dyndns.org/~cirdan/
Amiga user since '89, and damned proud of it too.
---------------------------------------------------------------------
Before posting, please check:
http://www.mysql.com/manual.php (the manual)
http://lists.mysql.com/ (the list archive)
To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php