title: Mysql CHECK Constraint
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/2115497/check-constraint-in-mysql-is-not-working">CHECK constraint in MySQL is not working</a>  </p>
  </blockquote>
  
  
  
  <p>I am student and now I have to work out what check means.
  We've got a little code:</p>
  
  <pre><code>CHECK (CHAR_LENGTH(PLZ) = 4) 
  </code></pre>
  
  <p>Now I have to find out what exactly it is doing. The problem is that I can't find anything in the internet(or i am doing something totaly wrong using google). 
  I created this code to test it:</p>
  
  <pre><code>CREATE TABLE Test(
      ID CHAR(4),
      CHECK (CHAR_LENGTH(ID) = 4)
  );
  
  INSERT INTO Test(ID) VALUES ('12345');
  </code></pre>
  
  <p>The problem is that I am not able to find any difference wheter I remove the line with the CHECK constraint or not. Now I am asking you? What is the difference wheter I use it or not. </p>