Check out example codes for "insert into select". It will help you in understanding the concepts better.

Code Example 1

INSERT INTO table2 (column1, column2, column3, ...)

SELECT column1, column2, column3, ...
 FROM table1

WHERE condition;

Code Example 2

INSERT INTO table2 (column1, column2, column3, ...)

SELECT column1, column2, column3, ...
 FROM table1

WHERE condition;

Code Example 3

INSERT INTO table2

SELECT * FROM table1
WHERE condition;

Code Example 4

INSERT INTO table2

SELECT * FROM table1
WHERE condition;

Code Example 5

INSERT INTO table2 (column1, column2, column3, ...)

SELECT column1, column2, column3, ...
 FROM table1

WHERE condition;

Learn ReactJs, React Native from akashmittal.com