#!/usr/bin/env python3
"""Auto-generated by AGI Loop cycle #1021
Task: Write a Python function that creates an in-memory SQLite database, creates a table, inserts 100 rows, and queries them
Generated: 2026-02-12T17:16:46.773852
"""

import sqlite3

def create_and_query_db():
    # Create an in-memory SQLite database
    conn = sqlite3.connect(':memory:')
    cursor = conn.cursor()

    # Create a table
    cursor.execute('''CREATE TABLE IF NOT EXISTS test_table (
                      id INTEGER PRIMARY KEY,
                      name TEXT,
                      value INTEGER)''')

    # Insert 100 rows
    for i in range(1, 101):
        cursor.execute('INSERT INTO test_table (name, value) VALUES (?, ?)', (f'Name_{i}', i * 10))

    # Query all rows
    cursor.execute('SELECT * FROM test_table')
    rows = cursor.fetchall()

    # Print the results
    for row in rows:
        print(row)

    # Close the connection
    conn.close()

if __name__ == '__main__':
    create_and_query_db()