It happened to me, and I hopped on google to find the code. In this example, we'll use my fictional User table. We want to know if our user is alive or dead. 1 = alive, 0 = dead. Here is the code for SQL server:
alter table dbo.Tbl_User_Table add constraintI don't know if it will work with MySql, Oracle, etc, so check your documentation. Happy Coding!
CK_User_Alive check (User_Alive in (0,1))