import sqlite3

def check():
    conn = sqlite3.connect("insurance.db")
    cursor = conn.cursor()
    cursor.execute("SELECT name FROM sqlite_master WHERE type='table';")
    tables = cursor.fetchall()
    print("Tables in insurance.db:", tables)
    for table_name in tables:
        t = table_name[0]
        try:
            cursor.execute(f"SELECT COUNT(*) FROM {t}")
            count = cursor.fetchone()[0]
            print(f"Table '{t}': {count} rows")
            if count > 0:
                cursor.execute(f"SELECT * FROM {t} LIMIT 5")
                print(cursor.fetchall())
        except Exception as e:
            print(f"Error reading table {t}: {e}")
    conn.close()

if __name__ == "__main__":
    check()
