Php and Mysql
Php and Mysql
php
?>
The CHECK constraint in SQL is used to limit the value range that can be placed in a column. If you
define a CHECK constraint on a column (for the Age column in this case) with the condition CHECK
(Age>=18), it enforces that only values of 18 or higher can be inserted into this column.
If you attempt to insert a record with an Age value less than 18, the database will reject the insert
operation, and you will receive an error from the DBMS (Database Management System). This error will
prevent the entire SQL statement from executing, so even if there are multiple rows being inserted with
one INSERT command, none of the rows will be inserted if at least one row violates the CHECK
constraint.
For instance, if you have the following SQL statement: