Define a Check Constraint That References to Multiple Columns
A check constraint can refer to multiple columns. In this case, you must define the check constraint as a table constraint.
See the following new sunshine table:
Query:
constraint due_date
CHECK (end_date >= begin_date)
Explanation: In this example, the due_date check constraint specifies that the end date must be the same or later than the beginning date:
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.