I have a table myTable having a foreign key, let's say it's called credential_id. Most of the time an authenticated user uses it by doing some actions thus credential_id points to some value (when a row is being inserted into myTable, credential_id has a value).
However, I want to allow anonymous (not authenticated or guests) users also do some actions involving this table. Since they are not authenticated, credential_id can't have any value.
I wonder, what would be better: to allow null values for credential_id or create a special account for an anonymous user and use it whenever the user is not authenticated? The question is about so-called null pattern in a way, but regarding a database.