<?xml version="1.0" encoding='utf-8'?>
<!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.1//EN" "http://www.wapforum.org/DTD/wml_1.1.xml">
<wml>
<card id="card1" title="Check constraint - Page 4 - Wikipedia">
<p>
<a accesskey="1" href="page.php?w=Check_constraint&amp;p=3">1.Previous</a><br />
<a accesskey="3" href="page.php?w=Check_constraint&amp;p=5">3.Next</a>
</p>
<p>will not be able to add invalid data or modify valid data so the data becomes invalid, even if the application itself accepts invalid data.</p>

<p><big>Definition</big></p>
<p>Each check constraint has to be defined in the <code>CREATE TABLE</code> or <code>ALTER TABLE</code> statement using the syntax:</p>

<p> CREATE TABLE table_name (     ...,     CONSTRAINT constraint_name CHECK ( predicate ),     ... )</p>

<p> ALTER TABLE table_name    ADD CONSTRAINT constraint_name CHECK ( predicate )</p>

<p>If the check constraint refers to a single column only,</p><p>
<a accesskey="1" href="page.php?w=Check_constraint&amp;p=3">1.Previous</a><br />
<a accesskey="3" href="page.php?w=Check_constraint&amp;p=5">3.Next</a>
</p>

<do type="prev" label="Search">
        <go href="search.wml"/>
</do>

</card>
</wml>
