How do I put a constraint on a column so that it can only contain the following values? What do you call this type of constraint?
Allowed values: \"yes\", \"no\"
you can use a CHECK constraint
ALTER TABLE <table>
ADD CONSTRAINT chk_val CHECK (col in ('yes','no','maybe'))
MSDN link
Yes, check a constraint is it what you need. You can declare check constraint at the table declaration:
CREATE TABLE test(
_id BIGINT PRIMARY KEY NOT NULL,
decision NVARCHAR(5),
CHECK (decision in ('yes','no','maybe'))
);
Using enumeration table is a way to go.