Integrity constraints ensure that data complies with business rules and prevent invalid data from being inserted into database tables. This topic describes how to use integrity constraints to prevent invalid data from being inserted into database tables.
In the MySQL mode of OceanBase Database, a tenant can use integrity constraints to prevent invalid data from being inserted into database tables. Integrity constraints ensure that data stored in databases complies with specific business rules. If a DML statement is executed but violates an integrity constraint, the statement is rolled back, and an error message is returned.
For example, assume that you have defined an integrity constraint on the salary column of the employees table. This integrity constraint disallows the insertion of a row where the value in the salary column is greater than 10000 into the employees table. If an INSERT or UPDATE statement violates this integrity constraint, the statement is rolled back, and an error message is returned.
For more information about integrity constraints, see Data integrity.