Check out example codes for "Mysql table variables". It will help you in understanding the concepts better.

Code Example 1

CREATE PROCEDURE my_proc () 
BEGIN

CREATE TEMPORARY TABLE TempTable (myid int, myfield varchar(100)); 
INSERT INTO TempTable SELECT tblid, tblfield FROM Table1; 
...
-- Temporary tables in MySQL only exist for the duration of the connection 
-- and only for the connected user, unlike MSSQL where they persist across 
-- sessions and connections.

Learn ReactJs, React Native from akashmittal.com