Create an table, generate rows and get rows by some values with MySQLdb