If I wanted to add a column that could only be two values, for example, a column called 'Gender' with the two possible options of 'Male' or 'Female'
use CHECK
Gender VARCHAR(6) NOT NULL CHECK (Gender IN ('Male', 'Female'))
I would probably want to use a bit field type, and not allow nulls, so that value can only be 0 or 1 (true/false).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With