insert data in multiple tables in one mysql query Suppose there are two tables e1 and e2 with
e1
|id |time     | ca| cb|
|1  | 12:20:00| 5 | 10|
|2  | 12:25:00| 9 | 6 |

and:
e2
|id| time    | cc|   
|1 | 12:20:00| 11|  
|2 | 12:25:00| 50|

Now I want to insert third record ine1 and e2 having id:3 and store id,time in both table and ca,cb in e1 and cc in e2.it should be perform in single query.
e1
|id | time       |  ca|   cb  |
|1  |  12:20:00  |  5 |   10  |
|2  | 12:25:00   |  9 |   6   |
|**3|   12:28:00 |  11|    7**|

and:
e2
id| time      |  cc|   
|1|  12:20:00 |  11|  
|2|   12:25:00|  50|
|**3| 12:28:00|  23**|

whether its possible ?I am novice to MySQL
Here are two ways to provide the appearance of &quot;should be performed in single query&quot;.  What is your goal behind requesting such?
Data integrity  (see &quot;ACID&quot;)
There are cases where you 'must' tie two inserts together, else the integrity of the database is in question.  The classic example is moving money from one account to another, but that usually involves a single table.
 BEGIN;
 UPDATE ... take money out of one person's account
 UPDATE ... add that money to another person's account
 COMMIT;

Whether the same table or different tables are involved, the above guarantees that both operations will be done or neither will be done.  The &quot;money&quot; won't vanish even if there is a power failure at any time during the &quot;transaction&quot;.
Is that what you need for &quot;inserting into two table at the same time&quot;?  A transaction can, and should, be used for any set of writes to table(s) in database(s) (on a single instance of MySQL) where the writes must be done &quot;at the same time&quot;.
Programming
Akina suggests using a Stored Procedure as a way to programmatically wrap the sequence of events, thereby giving the user the appearance of a &quot;single operation&quot;:
CALL Transfer(acct1, acct2, amount);