Search Results
https://dev.mysql.com/doc/refman/8.4/en/create-table-check-constraints.html
CREATE TABLE permits the core features of table and column CHECK constraints, for all storage engines. CREATE TABLE permits the following CHECK constraint syntax, for both table constraints and column constraints: [CONSTRAINT [symbol]] CHECK (expr) ...If omitted, MySQL generates a name from the table name, a literal _chk_, and an ordinal number (1, 2, 3, ...
https://dev.mysql.com/doc/refman/8.4/en/create-table-foreign-keys.html
MySQL supports foreign keys, which permit cross-referencing related data across tables, and foreign key constraints, which help keep the related data consistent. If the CONSTRAINT symbol clause is not defined, or a symbol is not included following ...A foreign key relationship involves a parent table that holds the initial column values, and a child table with column values that reference the parent column ...
https://dev.mysql.com/doc/ndbapi/en/ndb-error-codes-constraint-violation.html
The following list enumerates all NDB errors of type CV (Constraint violation).
https://dev.mysql.com/doc/refman/8.4/en/constraint-foreign-key.html
Foreign keys let you cross-reference related data across tables, and foreign key constraints help keep this spread-out data consistent. Since MySQL does not support deferred constraint checking, NO ACTION is treated as RESTRICT. For the exact ...
https://dev.mysql.com/doc/refman/8.4/en/constraint-primary-key.html
Normally, errors occur for data-change statements (such as INSERT or UPDATE) that would violate primary-key, unique-key, or foreign-key constraints. If you are using a transactional storage engine such as InnoDB, MySQL automatically rolls back the ...
https://dev.mysql.com/doc/refman/8.4/en/constraints.html
Because of this, constraint handling is a bit different in MySQL than in other DBMSs. The following sections describe how MySQL Server handles different types of constraints. MySQL enables you to work both with transactional tables that permit ...
https://dev.mysql.com/doc/refman/8.4/en/constraint-enum.html
Unless strict mode is disabled (not recommended, but see Section 7.1.11, “Server SQL Modes”), the definition of a ENUM or SET column acts as a constraint on values entered into the column. ENUM and SET columns provide an efficient way to define ...
https://dev.mysql.com/doc/mysql-errors/8.4/en/server-error-reference.html
If the error message refers to error 150, table creation failed because a foreign key constraint was not correctly formed. Error number: 1217; Symbol: ER_ROW_IS_REFERENCED; SQLSTATE: 23000 Message: Cannot delete or update a parent row: a foreign key ... The MySQL server writes some error messages to its error log, and sends others to client ...
https://dev.mysql.com/doc/refman/8.4/en/alter-table.html
| ADD [CONSTRAINT [symbol]] UNIQUE [INDEX | KEY] [index_name] [index_type] (key_part,...) [index_option] ... Foreign Keys and Other Constraints The FOREIGN KEY and REFERENCES clauses are supported by the InnoDB and NDB storage engines, which ...
https://dev.mysql.com/doc/refman/8.4/en/information-schema-referential-constraints-table.html
The REFERENTIAL_CONSTRAINTS table has these columns: CONSTRAINT_CATALOG The name of the catalog to which the constraint belongs. CONSTRAINT_SCHEMA The name of the schema (database) to which the constraint belongs. UNIQUE_CONSTRAINT_CATALOG The name ...The possible values are CASCADE, SET NULL, SET DEFAULT, RESTRICT, NO ...