Adding CHECK Constraints to an Existing Table
The alter table add constraint statement allows you to add a check constraint to an existing table:
Syntax:
ALTER TABLE table_name
ADD constraint constraint_name
CHECK (expression);
Output:
Explanation: For example, the following example adds a check constraint to the sunshine table:
MariaDB CHECK Constraint
MariaDB Server is one of the most popular open-source relational databases. It’s made by the original developers of MySQL and guaranteed to stay open source. It is part of most cloud offerings and the default in most Linux distributions.
MariaDB Server turns data into structured information in a wide array of applications, ranging from banking to websites. Originally designed as an, enhanced, drop-in replacement for MySQL, MariaDB Server is used because it is fast, scalable, and robust, with a rich ecosystem of storage engines, plugins, and many other tools that make it very versatile for a wide variety of use cases.
MariaDB is widely used to maintain high compatibility with open-source, with exact matching with MySQL APIs and commands. It includes new storage engines like Aria, ColumnStore, and MyRocks.
Contact Us