Python program that takes input and runs queries on a mySQL database on it
A comment on this bit:

customerNumbers = '('
for prime in primeCustomers:
    customerNumbers += str(prime.id)
    customerNumbers += ', '

# Remove the trailing comma and space and add ending parenthesis 
customerNumbers = customerNumbers[:-2]
customerNumbers += ')'


can be written as:

customerNumbers = '(' + ', '.join(str(x) for x in primeCustomers.id) + ')'


My final comment has to do with the use of fetchone() instead of fetchall(). Is there a reason you do it like that? Instead of having the while statements which you have to evaluate in every loop you can just fetch all results and process them in a less "expensive" for loop like that:

rows = cur.fetchall()
for row in rows:
    #do stuff with the results of every row.