title: Double Not Exists SQL Logic Explanation
body: <p>There are 2 tables, one called drinkers with a column of names, another called frequents which has 2 columns, drinker and bars (that they frequent).</p>
  
  <p>I have a query that answers this statement: </p>
  
  <pre><code>Drinkers who frequent all bars 
  </code></pre>
  
  <p>or wordered differently:</p>
  
  <pre><code>Drinkers such that there aren’t any bars that they don’t frequent
  </code></pre>
  
  <p>Now here is the resulting query:</p>
  
  <pre><code>SELECT d.name
  FROM drinkers d
  WHERE NOT EXISTS (
      SELECT b.name
      FROM bars b
      WHERE NOT EXISTS (
          SELECT *
          FROM frequents f
          WHERE f.drinker = d.name
          AND f.bar = b.name
          )
         )
  </code></pre>
  
  <p>I am having the hardest time following the logic when two <code>NOT EXISTS</code> are used. 
  If someone can walk me through how to understand these types of queries, it would be much appreciated. Thank you.</p>