I have a table with two columns. State and Name. State can have two values, 0 and 1. When the state is 1, there needs to be a value in the column Name. If the state is 0 the Name must be null.
My question is what is considered as a good database design. I've come up with two options.
- Remove the column state and just distinguish the state whatever the Name value is null or not.
- Have the column State distinguish the state. But then I need to somehow enforce not null values in the case state is 1.