It’s not possible with one query as INSERT
can only insert data to one table in mysql. You can either
- write this as two queries and execute them as a batch
- create a stored procedure that would execute two insert command
You can wrap those inserts in transaction if you need to make sure that both queries will write the data.