SQL WITH DOMAIN CONSTRAINTS(check constraints)
MySQL CREATE TABLE with CHECK CONSTRAINT using IN operator
MySQL CHECK CONSTRAINT can be applied to a column of a table, to set a limit for storing values within a range, along with IN operator.
Example
If you want to create a table 'newauthor' with a PRIMARY KEY on a combination of two columns (aut_id,home_city) and checking a limit value for the column country are 'USA','UK' and 'India', the following statement can be used.
Comments
Post a Comment