Hello. I apologize for such a question, but I do not know how to formulate it differently. I'll be brief. For example, there are 2 tables. 
How can I add a line to the order table if I know only the buyer’s name and price. (So ​​I know the Name from the byer and Price tables ) I use the mysql connector / Python I tried the subquery. But it didn't work for me. And it seems to me that the subquery for such a simple task is not correct.
insert into order(ByerId,Price) select id,? from byer where Name=?. Your variables are substituted for questions (are they used in python?used ... - Mikeordertable name is not necessary to escape (as a keyword)? - Igor