title: What does CAST function do?
body: <p>I encountered these statements in the SQL and I don't understand what will be the output using <strong>CAST</strong> function?</p>
  
  <p>These are the statements:</p>
  
  <ol>
  <li><code>cast(date_var - 19000000 as DATE) + 1  as integer</code></li>
  </ol>
  
  <p>will this output the next day of date_var?</p>
  
  <ol start="2">
  <li><code>cast(substr('date_var',1,6) || '01' as integer) - 10000</code></li>
  </ol>
  
  <p>I'm more confused on what will be the output on this?</p>