I have table in MySql database want to limit some column value,
is it possible to make a column in table to take specified value such as (value <= 3) ?
I have table in MySql database want to limit some column value,
is it possible to make a column in table to take specified value such as (value <= 3) ?
you need to use a constraint named check which will be defined on table creation and check the value before insert .
CREATE TABLE table_name (
value INT ,
CHECK(value <= 3)
)