Our database includes a USERS table for storing user-specific data, and each user has a status, either
inactive. It suffices to indicate the status using a
is_active boolean field in the USERS table.
At the same time, for "inactive" users, we keep additional information in another field, which is irrelevant (and therefore set to null) for users in the opposite ("active") status.
My question: Is it a better design to keep the
is_active boolean field in the USERS table to clearly indicate the status, or actually derive the status based on the available secondary criteria (the availability of the additional info, which is present always and only if the user is in status "inactive")?
That is, it looks like the
is_active field is redundant with regards to DB normalization, but at the same time, the logic that can be used for deriving it isn't so obvious at first grasp and that makes queries concerning the status seem cumbersome and containing non-explicit logic.