mysql CHECK constraints syntax
Function: CHECK constraints are used to limit the range of values in the column.
Note: If a CHECK constraint is defined on a single column, only specific values are allowed for that column. If a CHECK constraint is defined on a table, the constraint limits values in a specific column.
mysql CHECK constraints example
//在 "Persons" 表创建时为 "Id_P" 列创建 CHECK 约束。CHECK 约束规定 "Id_P" 列必须只包含大于 0 的整数。 CREATE TABLE Persons(Id_P int NOT NULL,LastName varchar(255) NOT NULL,FirstName varchar(255),Address varchar(255),City varchar(255),CHECK (Id_P>0));