title: sql check constraint age from birthdate
body: <p>How can I have a check constraint for <code>age &lt; 40 from birthdate</code> when creating a table? 
  Something like:</p>
  
  <pre><code>SELECT DATEDIFF(yy,” Birthdate ”, getdate()) as age
  age&lt;40
  </code></pre>
  
  <p>Then how could I have another check constraint when creating table and counting an attribute, grouping it and checking if it's > 6?</p>
  
  <p>Such as below but as a check constraint?</p>
  
  <pre><code>select count(attributex) as counter from entityx
  group by attributex
  having counter&gt;6
  </code></pre>