title: How to write test assertions using SQL in dbt
body: <p>I am new to dpt and I am trying to write a test assertion in SQL to validate some data</p>
  <p>table name: lex</p>
  <div class="s-table-container">
  <table class="s-table">
  <thead>
  <tr>
  <th style="text-align: left;">id</th>
  <th style="text-align: center;">date</th>
  <th style="text-align: right;">ip</th>
  </tr>
  </thead>
  <tbody>
  <tr>
  <td style="text-align: left;">001</td>
  <td style="text-align: center;">2022-01-14 15:03:43.000</td>
  <td style="text-align: right;">4.33.46.173</td>
  </tr>
  <tr>
  <td style="text-align: left;">002</td>
  <td style="text-align: center;">2022-01-14 15:03:43.000</td>
  <td style="text-align: right;">3.33.46.173</td>
  </tr>
  <tr>
  <td style="text-align: left;">003</td>
  <td style="text-align: center;">2022-01-14 15:03:43.000</td>
  <td style="text-align: right;">2.33.46.173</td>
  </tr>
  </tbody>
  </table>
  </div>
  <p>The objective is to write an SQL query that determines if a value exists or not.
  For example, the query below produces an output</p>
  <pre><code>select id,
         date,
         ip
  from lex
  where id = 001 AND date= '2022-01-14 15:03:43.000' AND ip = '4.33.46.173'
  </code></pre>
  <p>Output: which passes the test</p>
  <div class="s-table-container">
  <table class="s-table">
  <thead>
  <tr>
  <th style="text-align: left;">id</th>
  <th style="text-align: center;">date</th>
  <th style="text-align: right;">ip</th>
  </tr>
  </thead>
  <tbody>
  <tr>
  <td style="text-align: left;">001</td>
  <td style="text-align: center;">2022-01-14 15:03:43.000</td>
  <td style="text-align: right;">4.33.46.173</td>
  </tr>
  </tbody>
  </table>
  </div>
  <p>however, if it does not exist, it produces a blank table which still passes</p>
  <div class="s-table-container">
  <table class="s-table">
  <thead>
  <tr>
  <th style="text-align: left;">id</th>
  <th style="text-align: center;">date</th>
  <th style="text-align: right;">ip</th>
  </tr>
  </thead>
  </table>
  </div>
  <p>My issue is how do I represent it in a way that when the data does not exist I should get no data notification</p>