CREATE TABLE Statement The SQL standard specifies that all types of constraints (primary key, unique index, foreign key, check) belong to the same namespace. In MySQL, each constraint type has its own namespace per schema (database). Consequently,  CHECK  constraint names must be unique per schema; no two tables in the same schema can share a  CHECK  constraint name. (Exception: A  TEMPORARY  table hides a non- TEMPORARY  table of the same name, so it can have the same  CHECK  constraint names as well.) Beginning generated constraint names with the table name helps ensure schema uniqueness because table names also must be unique within the schema. CHECK  condition expressions must adhere to the following rules. An error occurs if an expression contains disallowed constructs. Foreign key referential actions ( ON UPDATE ,  ON DELETE ) are prohibited on columns used in  CHECK constraints. Likewise,  CHECK  constraints are prohibited on columns used in foreign key referential actions. CHECK  constraints are evaluated for  INSERT ,  UPDATE ,  REPLACE ,  LOAD DATA , and  LOAD XML  statements and an error occurs if a constraint evaluates to  FALSE . If an error occurs, handling of changes already applied differs for transactional and nontransactional storage engines, and also depends on whether strict SQL mode is in effect, as described in Strict SQL Mode. CHECK  constraints are evaluated for  INSERT IGNORE ,  UPDATE IGNORE ,  LOAD DATA ... IGNORE , and LOAD XML ... IGNORE  statements and a warning occurs if a constraint evaluates to  FALSE . The insert or update for any offending row is skipped. If the constraint expression evaluates to a data type that differs from the declared column type, implicit coercion to the declared type occurs according to the usual MySQL type-conversion rules. See Section 12.3, “Type Conversion in Expression Evaluation” . If type conversion fails or results in a loss of precision, an error occurs. Note Constraint expression evaluation uses the SQL mode in effect at evaluation time. If any component of the expression depends on the SQL mode, different results may occur for different uses of the table unless the SQL mode is the same during all uses. 2583 •Nongenerated and generated columns are permitted, except columns with the  AUTO_INCREMENT attribute and columns in other tables. •Literals, deterministic built-in functions, and operators are permitted. A function is deterministic if, given the same data in tables, multiple invocations produce the same result, independently of the connected user. Examples of functions that are nondeterministic and fail this definition:  CONNECTION_ID() , CURRENT_USER() ,  NOW() . •Stored functions and loadable functions are not permitted. •Stored procedure and function parameters are not permitted. •Variables (system variables, user-defined variables, and stored program local variables) are not permitted. •Subqueries are not permitted. CONSTRAINT ‘t1_chk_1‘ CHECK ((‘c1‘ <> ‘c2‘)), CONSTRAINT ‘t1_chk_2‘ CHECK ((‘c1‘ > 10)), CONSTRAINT ‘t1_chk_3‘ CHECK ((‘c3‘ < 100)), CONSTRAINT ‘t1_chk_4‘ CHECK ((‘c1‘ > ‘c3‘)) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci