title: Best way to enforce inter-table constraints inside database
body: <p>I looking for the best way to check for inter-table constraints an step forward of foreing keys. For instance, to check if a date child record value is between a range date on two parent rows columns. For instance:</p>
  
  <pre><code>Parent table  
  ID    DATE_MIN   DATE_MAX
  ----- ---------- ----------
  1     01/01/2009 01/03/2009
  ...
  
  Child table
  PARENT_ID  DATE
  ---------- ----------
  1          01/02/2009
  1          01/12/2009   &lt;--- HAVE TO FAIL!
  ...
  </code></pre>
  
  <p>I see two approaches:</p>
  
  <ul>
  <li>Create materialized views on-commit as shown in <a href="http://www.dbazine.com/oracle/or-articles/tropashko8" rel="nofollow noreferrer">this article</a> (or other equivalent on other RDBMS).</li>
  <li>Use stored-procedures and triggers.</li>
  </ul>
  
  <p>Any other approach? Which is the best option?</p>
  
  <p><strong>UPDATE</strong>: The motivation of this question is <strong>not</strong> about "putting the constraints on database or on application". I think this is a tired question and anyone does the way she loves. And, I'm sorry for detractors, I'm developing with constraints on database. <strong>From here</strong>, the question is "which is the best option to manage inter-table constraints on database?". I'm added "inside database" on the question title.</p>
  
  <p><strong>UPDATE 2</strong>: Some one added the "<em>oracle</em>" tag. Of course materialized views are oracle-tools but I'm interested on <strong>any</strong> option regardless it's on oracle or others RDBMSs.</p>