title: Selecting data in an Sqlite3 database-Python
body: <p>The code below i got as i was learning about Sqlite3-Python for creating a simple database. creating its tables and inserting data...</p>
  
  <pre><code>import sqlite3
  db=sqlite3.connect('E:/CLYDE/sqlite new2/dbase.db')
  cursor=db.cursor()
  cursor.execute('''CREATE TABLE users(id INTEGER PRIMARY KEY, name TEXT,
                         phone TEXT, email TEXT unique, password TEXT)''')
  db.commit()
  
  name1 = 'Andres'
  phone1 = '3366858'
  email1 = 'user@example.com'
  # A very secure password
  password1 = '12345'
  
  name2 = 'John'
  phone2 = '5557241'
  email2 = 'johndoe@example.com'
  password2 = 'abcdef'
  
  users = [(name1,phone1, email1, password1),
           (name2,phone2, email2, password2)]
  cursor.executemany(''' INSERT INTO users(name, phone, email, password) VALUES(?,?,?,?)''', users)
  db.commit()
  </code></pre>
  
  <p>The piece of code (in the same directory as the one above)  below is mearnt to determine if a certain element (string) is in the database. What way can be used to determine this? currently its always printing no, for any item in the database.</p>
  
  <pre><code>import sqlite3
  db = sqlite3.connect('dbase.db')
  cursor = db.cursor()
  cursor.execute('SELECT * FROM users')
  all_rows = cursor.fetchall()
  if 'John' in all_rows:
    print('yes')
  else:
    print('no')
  db.close()
  </code></pre>