title: SQLite3 inconsistency mistake in between function
body: <p>I am using the SQLite3 database with Python and already inserted the data via a csv import. While I was playing around with it to get used to the database and trying various commands, I realised that there has to be a mistake somewhere.</p>
  
  <p>The mistake is visible in the result of the last line:</p>
  
  <pre><code>import sqlite3
  con = sqlite3.connect('databaseTest.db')
  cur = con.cursor()
  
  cur.execute("SELECT avg(LOAN_AMOUNT) FROM loans")
  print(cur.fetchone())            # Result: 832.23€
  
  cur.execute("SELECT count(*) FROM loans WHERE LOAN_AMOUNT BETWEEN 1000 AND 2000")
  print(cur.fetchone())            # Result: 414114
  
  cur.execute("SELECT count(*) FROM loans WHERE LOAN_AMOUNT BETWEEN 500 AND 2000")
  print(cur.fetchone())            # Result: 0
  </code></pre>
  
  <p>As you can see the error happens in the last statement where it says that there are 0 loans with an amount between 500 and 2000 (while there are 414114 loans with an amount between 1000 and 2000).</p>
  
  <p>Does anyone have an idea what I did wrong? I am very new to coding and working with databases, so it might as well be a very simple, stupid mistake. I checked the data in the database which seem to be all fine.</p>
  
  <p>Any help is much appreciated!</p>