Em Fri, 15 Aug 2003 18:16:14 +0200, Philipp Lenssen escreveu:
Quote:
working on a project which should store data from a long
survey. His single table now has many, many columns (labelled "a_1_1"
and so on), with different data types (some boolean, some integers, some
text, and so on).
Is there a way to optimize this? |
Presumably the survey is a consolidation of assorted
information about many different entities. One should determine the
entities, model the database and normalise it. One will probably end
up with many different relations, and no NULLs -- probably special
values, but no NULLs.
Quote:
E.g. what would be if the next survey comes along, one which has
different fields. |
Depends.
If one insists on treating the survey as one entity, the next
different survey is obviously another entity, and thus another
relation.
If one has modeled the database according to perceived
entities and normalised it, the next survey will be a simple addition
of the new entities and attributes, as new relations and perhaps new
attributes in old relations. One might even come to create views to
preserve the old logical model without using neither NULLs nor default
values without a meaning...
Suggestion: grok the relational model by reading Date.
--
_ Leandro Guimarães Faria Corsetti Dutra +41 (21) 648 11 34
/ \ http://br.geocities.com./lgcdutra/ +41 (78) 778 11 34
\ / Responda Ã* lista, não a mim diretamente! +55 (11) 5686 2219
/ \ Dê nota se ajudei: http://svcs.affero.net/rm.php?r=leandro