Jim C Nasby:
> OK, but compare the amount of work you just described to the
simplicity
> of using an enum. Enum is much easier and simpler for a developer. Of
> course in most cases the MySQL way of doing it is (as has been
> mentioned) stupid, but done in the normal, normalized way it would
> remove a fair amount of additional work on the part of a developer:
>
> - no need to manually define seperate table
create table color (color text);
insert into color values ('red'); -- etc
> - no need to define RI
references color
> - no need to manually map between ID and real values (though of course
if you use color as p-key this is unnecessary
> we should make it easy to get the ID too)
again, in this case the color should be the id and using a surrogate key
is poor design. If that's too much typing you have the option of a
check constraint which is superior to enum in just about every way,
particularly if encapsulated into a domain (although inferior to RI
solution, IMO).
Merlin