MySql workbench CHECK constraint
<p>Here I want to create 2 CHECK constraint before the record insert to the database.</p>

<pre><code>ALTER TABLE SubjectEnrollment
ADD CONSTRAINT register CHECK (register &lt;= classSize AND register &gt;=0),
ADD CONSTRAINT available CHECK (available &lt;= classSize AND available &gt;= 0);
</code></pre>

<ol>
<li>register attribute should not more than classSize attribute and less than 0. </li>
<li>available attribute should not more than classSize attribte and less than 0.</li>
</ol>

<p>When I type in this syntax in MySql Workbench, it complaints "Syntax Error: unexpected 'CHECK' (check)'. How should I add these, using TRIGGER?</p>

<p>Thank you.</p>