Check out example codes for "insert data into multiple tables mysql". It will help you in understanding the concepts better.

Code Example 1

BEGIN;
INSERT INTO users (username, password)
  VALUES('test', 'test');
INSERT INTO profiles (userid, bio, homepage) 
  VALUES(LAST_INSERT_ID(),'Hello world!', 'http://www.stackoverflow.com');
COMMIT;

Learn ReactJs, React Native from akashmittal.com