I think you should store this as a bit (if you care about storage size), and let NULL
mean "unknown".
field bit(1) default NULL,
It seems strange to declare a field to be not null
and then to have a special value that, essentially, means NULL
.
EDIT:
The following syntax "works" on SQL Fiddle:
create table t (
val int,
flag tinyint(1) default -1
);
"works" is in quotes because the default value prints as "1" rather than "-1" -- after all, the (1)
is saying just print one digit.
Perhaps in some earlier versions of MySQL it generates an error when it sees that -1
won't display correctly. (To be honest, that would surprise me.)