cursor.execute('INSERT INTO users VALUES(NULL, "john.smith@python.com", "John Smith")') cursor.execute('INSERT INTO cars VALUES(NULL, "Fiat", "Polo", 1)') cursor.execute('INSERT INTO cars VALUES(NULL, "BMW", "X6", 1)') cursor.execute('INSERT INTO cars VALUES(NULL, "Mazda", "6", 2)') #fails, no owner of 2 #-------------------------------------------------------------------- rows = list(cursor.execute('SELECT email FROM users WHERE name="John Smith"')) rows1 = list(cursor.execute('SELECT * FROM cars')) print(rows, rows1)