title: Query that checks if all conditions are met
body: <p>Lets say I have an example table called conditions:</p>
  
  <pre><code>CREATE TABLE conditions (
    id int NOT NULL,
    age_from int,
    age_to int,
    height_from int,
    height_to int,
    PRIMARY KEY (id)
  );
  </code></pre>
  
  <p>I insert a couple of conditions:</p>
  
  <pre><code>INSERT INTO conditions (age_from, age_to, height_from, height_to) 
  VALUES (10, 14, NULL, 200);
  INSERT INTO conditions (age_from, age_to, height_from, height_to) 
  VALUES (NULL, NULL, 170, 250);
  </code></pre>
  
  <p>Given these conditions 
  a person with age: 11 and height: 180 would meet the criteria, but a person with age: 15 and height: 169 would not.</p>
  
  <p>So my first thought is to count all the conditions that are met and compare to the total count of conditions.
  The fact that some of these conditions can be <code>NULL</code> makes the query a bit complex.</p>
  
  <p>Something along these lines would not work, since I'd have to check if the specific conditions are <code>NOT NULL</code> and then compare, which would make the query quite complex.</p>
  
  <pre><code>WHERE age_from &lt;= 11 AND age_to &gt;= 11 -- or using BETWEEN
  </code></pre>
  
  <p>Is there a more elegant way to write a query or restructure the <code>conditions</code> table to achieve my goal?</p>