sql constraint check value in list
snippet in sql

sql constraint check value in list

user8784

ALTER TABLE <table>
ADD CONSTRAINT chk_val CHECK (col in ('yes','no','maybe'))

sql constraint check value in list

user3554

CREATE TABLE test(
    _id BIGINT PRIMARY KEY NOT NULL,
    decision NVARCHAR(5),
    CHECK (decision in ('yes','no','maybe'))
);