I have a question that's more of the hypothetical kind.
I have two tables:
Now I'd like to make one (or zero) email address per user the default address.
On an ANSI compliant system I could simply add a nullable column to the email table and add a check so that the value can only be 'DEFAULT' or null and add a unique composite key on this column and the userid column.
This would of course not work on certain databases that don't allow more than one null value when having a unique key.
So what other solutions are there? Preferrably not allowing null values.