A MySQL tenant of OceanBase Database can use integrity constraints to prevent invalid data from being inserted into database tables. This topic describes integrity constraints and their application scenarios.
Integrity constraints are used to ensure that the information stored in a database complies with specific business rules. For example, if the execution result of a DML statement violates an integrity constraint, the statement is rolled back and an error message is returned.
The operations performed on a view are subject to the integrity constraints on the corresponding base table.
For example, assume that you have defined an integrity constraint on the salary column of the employees table. This integrity constraint requires that no row containing a numeric value greater than 10,000 in the salary column can be inserted to the employees table. If an INSERT or UPDATE statement violates this integrity constraint, the statement is rolled back, and an error message is returned.