examples/database/sql_select.py
#!/usr/bin/env python
from __future__ import print_function

import sqlite3

conn = sqlite3.connect("sample.db")
c = conn.cursor()

minimum = 0

sql = '''SELECT * FROM companies WHERE employees >= ?'''
for company in c.execute(sql, (minimum,)):
  print(company)

sql = '''SELECT COUNT(*) FROM companies WHERE employees >= ?'''
c.execute(sql, (minimum,))
print(c.fetchone()[0])

conn.close()

Use the result as an iterator, or call the fetchone method. If the result set might be empty, then the fetchone might return None. Check for it!