#!/usr/bin/env python

import sys
import mysql.connector

def insert():
    cursor = connection.cursor()
    try:
        cursor.execute("drop table employees")
    except:
        pass
    cursor.execute("create table employees (id integer primary key, name text)")
    cursor.close()

    print("Inserting employees...")
    for n in xrange(0, 10000):
        cursor = connection.cursor()
        cursor.execute("insert into employees (id, name) values (%d, 'Employee_%d')" %
                       (n, n))
        connection.commit()
        cursor.close()

def select():
    print("Selecting employees...")
    while True:
        cursor = connection.cursor()
        cursor.execute("select * from employees where name like '%1417773'")
        for row in cursor:
            pass
        cursor.close()

connection = mysql.connector.connect(host='localhost', database='test')

if "insert" in sys.argv:
    while True:
        insert()
elif "insert_once" in sys.argv:
    insert()
elif "select" in sys.argv:
    select()
else:
    print("USAGE: data_access.py <insert|insert_once|select>")

connection.close()

@@ -16,16 +16,43 @@
 python%0A%0A
+from random import randint%0A
 import s
@@ -78,16 +78,39 @@
 nector%0A%0A
+NUM_EMPLOYEES = 10000%0A%0A
 def inse
@@ -389,21 +389,29 @@
 ange(0, 
-10000
+NUM_EMPLOYEES
 ):%0A     
@@ -785,17 +785,41 @@
 e '%25
-1417773'%22
+%25%25d'%22 %25 randint(0, NUM_EMPLOYEES)
 )%0A  

Change data access script to issue SELECTs that actually return a value